<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-99.9.9">

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">


<title>Fastmath documentation – Statistics</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
  width: 0.8em;
  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 
  vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
  }
pre.numberSource { margin-left: 3em;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>


<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./polynomials.html" rel="next">
<link href="./random.html" rel="prev">
<link href="./clay/resources/favicon.png" rel="icon" type="image/png">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
<script id="quarto-search-options" type="application/json">{
  "location": "sidebar",
  "copy-button": false,
  "collapse-after": 3,
  "panel-placement": "start",
  "type": "textbox",
  "limit": 50,
  "keyboard-shortcut": [
    "f",
    "/",
    "s"
  ],
  "show-item-context": false,
  "language": {
    "search-no-results-text": "No results",
    "search-matching-documents-text": "matching documents",
    "search-copy-link-title": "Copy link to search",
    "search-hide-matches-text": "Hide additional matches",
    "search-more-match-text": "more match in this document",
    "search-more-matches-text": "more matches in this document",
    "search-clear-button-title": "Clear",
    "search-text-placeholder": "",
    "search-detached-cancel-button-title": "Cancel",
    "search-submit-button-title": "Submit",
    "search-label": "Search"
  }
}</script>


</head>

<body class="nav-sidebar floating">

<div id="quarto-search-results"></div>
  <header id="quarto-header" class="headroom fixed-top">
  <nav class="quarto-secondary-nav">
    <div class="container-fluid d-flex">
      <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
        <i class="bi bi-layout-text-sidebar-reverse"></i>
      </button>
        <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./stats.html">Statistics</a></li></ol></nav>
        <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">      
        </a>
      <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
        <i class="bi bi-search"></i>
      </button>
    </div>
  </nav>
</header>
<!-- content -->
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
  <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto">
    <div class="pt-lg-2 mt-2 text-left sidebar-header">
    <div class="sidebar-title mb-0 py-0">
      <a href="./">Fastmath documentation</a> 
    </div>
      </div>
        <div class="mt-2 flex-shrink-0 align-items-center">
        <div class="sidebar-search">
        <div id="quarto-search" class="" title="Search"></div>
        </div>
        </div>
    <div class="sidebar-menu-container"> 
    <ul class="list-unstyled mt-1">
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./index.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Preface</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./core.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Core</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./vector_matrix.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vectors and matrices</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./random.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Random</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./stats.html" class="sidebar-item-text sidebar-link active">
 <span class="menu-text">Statistics</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./polynomials.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Polynomials</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./special.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Special functions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./calculus.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Calculus</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./interpolation.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Interpolation</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./optimization.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Optimization</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./transform.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Transforms</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./ml.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Machine Learning</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./complex_quaternions.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Complex numbers and quaternions</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./easings.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Easings</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./fields.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">Vector fields</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./efloat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">EFloat</span></a>
  </div>
</li>
    </ul>
    </div>
</nav>
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->
    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
        <nav id="TOC" role="doc-toc" class="toc-active">
    <h2 id="toc-title">Table of contents</h2>
   
  <ul>
  <li><a href="#reference" id="toc-reference" class="nav-link active" data-scroll-target="#reference">Reference</a>
  <ul>
  <li><a href="#fastmath.stats" id="toc-fastmath.stats" class="nav-link" data-scroll-target="#fastmath.stats">fastmath.stats</a>
  <ul>
  <li><a href="#statistics-functions." id="toc-statistics-functions." class="nav-link" data-scroll-target="#statistics-functions.">Statistics functions.</a></li>
  <li><a href="#confusion-matrix" id="toc-confusion-matrix" class="nav-link" data-scroll-target="#confusion-matrix">-&gt;confusion-matrix</a></li>
  <li><a href="#l0" id="toc-l0" class="nav-link" data-scroll-target="#l0">L0</a></li>
  <li><a href="#l1" id="toc-l1" class="nav-link" data-scroll-target="#l1">L1</a></li>
  <li><a href="#l2" id="toc-l2" class="nav-link" data-scroll-target="#l2">L2</a></li>
  <li><a href="#l2sq" id="toc-l2sq" class="nav-link" data-scroll-target="#l2sq">L2sq</a></li>
  <li><a href="#linf" id="toc-linf" class="nav-link" data-scroll-target="#linf">LInf</a></li>
  <li><a href="#acf" id="toc-acf" class="nav-link" data-scroll-target="#acf">acf</a></li>
  <li><a href="#acf-ci" id="toc-acf-ci" class="nav-link" data-scroll-target="#acf-ci">acf-ci</a></li>
  <li><a href="#ad-test-one-sample" id="toc-ad-test-one-sample" class="nav-link" data-scroll-target="#ad-test-one-sample">ad-test-one-sample</a></li>
  <li><a href="#adjacent-values" id="toc-adjacent-values" class="nav-link" data-scroll-target="#adjacent-values">adjacent-values</a></li>
  <li><a href="#ameasure" id="toc-ameasure" class="nav-link" data-scroll-target="#ameasure">ameasure</a></li>
  <li><a href="#binary-measures" id="toc-binary-measures" class="nav-link" data-scroll-target="#binary-measures">binary-measures</a></li>
  <li><a href="#binary-measures-all" id="toc-binary-measures-all" class="nav-link" data-scroll-target="#binary-measures-all">binary-measures-all</a></li>
  <li><a href="#binomial-ci" id="toc-binomial-ci" class="nav-link" data-scroll-target="#binomial-ci">binomial-ci</a></li>
  <li><a href="#binomial-ci-methods" id="toc-binomial-ci-methods" class="nav-link" data-scroll-target="#binomial-ci-methods">binomial-ci-methods</a></li>
  <li><a href="#binomial-test" id="toc-binomial-test" class="nav-link" data-scroll-target="#binomial-test">binomial-test</a></li>
  <li><a href="#bootstrap-deprecated" id="toc-bootstrap-deprecated" class="nav-link" data-scroll-target="#bootstrap-deprecated">bootstrap <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#bootstrap-ci-deprecated" id="toc-bootstrap-ci-deprecated" class="nav-link" data-scroll-target="#bootstrap-ci-deprecated">bootstrap-ci <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#brown-forsythe-test" id="toc-brown-forsythe-test" class="nav-link" data-scroll-target="#brown-forsythe-test">brown-forsythe-test</a></li>
  <li><a href="#chisq-test" id="toc-chisq-test" class="nav-link" data-scroll-target="#chisq-test">chisq-test</a></li>
  <li><a href="#ci" id="toc-ci" class="nav-link" data-scroll-target="#ci">ci</a></li>
  <li><a href="#cliffs-delta" id="toc-cliffs-delta" class="nav-link" data-scroll-target="#cliffs-delta">cliffs-delta</a></li>
  <li><a href="#coefficient-matrix" id="toc-coefficient-matrix" class="nav-link" data-scroll-target="#coefficient-matrix">coefficient-matrix</a></li>
  <li><a href="#cohens-d" id="toc-cohens-d" class="nav-link" data-scroll-target="#cohens-d">cohens-d</a></li>
  <li><a href="#cohens-d-corrected" id="toc-cohens-d-corrected" class="nav-link" data-scroll-target="#cohens-d-corrected">cohens-d-corrected</a></li>
  <li><a href="#cohens-f" id="toc-cohens-f" class="nav-link" data-scroll-target="#cohens-f">cohens-f</a></li>
  <li><a href="#cohens-f2" id="toc-cohens-f2" class="nav-link" data-scroll-target="#cohens-f2">cohens-f2</a></li>
  <li><a href="#cohens-kappa" id="toc-cohens-kappa" class="nav-link" data-scroll-target="#cohens-kappa">cohens-kappa</a></li>
  <li><a href="#cohens-q" id="toc-cohens-q" class="nav-link" data-scroll-target="#cohens-q">cohens-q</a></li>
  <li><a href="#cohens-u2" id="toc-cohens-u2" class="nav-link" data-scroll-target="#cohens-u2">cohens-u2</a></li>
  <li><a href="#cohens-u3" id="toc-cohens-u3" class="nav-link" data-scroll-target="#cohens-u3">cohens-u3</a></li>
  <li><a href="#cohens-w" id="toc-cohens-w" class="nav-link" data-scroll-target="#cohens-w">cohens-w</a></li>
  <li><a href="#contingency-2x2-measures" id="toc-contingency-2x2-measures" class="nav-link" data-scroll-target="#contingency-2x2-measures">contingency-2x2-measures</a></li>
  <li><a href="#contingency-2x2-measures-all" id="toc-contingency-2x2-measures-all" class="nav-link" data-scroll-target="#contingency-2x2-measures-all">contingency-2x2-measures-all</a></li>
  <li><a href="#contingency-table" id="toc-contingency-table" class="nav-link" data-scroll-target="#contingency-table">contingency-table</a></li>
  <li><a href="#contingency-table-marginals" id="toc-contingency-table-marginals" class="nav-link" data-scroll-target="#contingency-table-marginals">contingency-table-&gt;marginals</a></li>
  <li><a href="#correlation" id="toc-correlation" class="nav-link" data-scroll-target="#correlation">correlation</a></li>
  <li><a href="#correlation-matrix" id="toc-correlation-matrix" class="nav-link" data-scroll-target="#correlation-matrix">correlation-matrix</a></li>
  <li><a href="#count" id="toc-count" class="nav-link" data-scroll-target="#count">count=</a></li>
  <li><a href="#covariance" id="toc-covariance" class="nav-link" data-scroll-target="#covariance">covariance</a></li>
  <li><a href="#covariance-matrix" id="toc-covariance-matrix" class="nav-link" data-scroll-target="#covariance-matrix">covariance-matrix</a></li>
  <li><a href="#cramers-c" id="toc-cramers-c" class="nav-link" data-scroll-target="#cramers-c">cramers-c</a></li>
  <li><a href="#cramers-v" id="toc-cramers-v" class="nav-link" data-scroll-target="#cramers-v">cramers-v</a></li>
  <li><a href="#cramers-v-corrected" id="toc-cramers-v-corrected" class="nav-link" data-scroll-target="#cramers-v-corrected">cramers-v-corrected</a></li>
  <li><a href="#cressie-read-test" id="toc-cressie-read-test" class="nav-link" data-scroll-target="#cressie-read-test">cressie-read-test</a></li>
  <li><a href="#demean" id="toc-demean" class="nav-link" data-scroll-target="#demean">demean</a></li>
  <li><a href="#dissimilarity" id="toc-dissimilarity" class="nav-link" data-scroll-target="#dissimilarity">dissimilarity</a></li>
  <li><a href="#durbin-watson" id="toc-durbin-watson" class="nav-link" data-scroll-target="#durbin-watson">durbin-watson</a></li>
  <li><a href="#epsilon-sq" id="toc-epsilon-sq" class="nav-link" data-scroll-target="#epsilon-sq">epsilon-sq</a></li>
  <li><a href="#estimate-bins" id="toc-estimate-bins" class="nav-link" data-scroll-target="#estimate-bins">estimate-bins</a></li>
  <li><a href="#estimation-strategies-list" id="toc-estimation-strategies-list" class="nav-link" data-scroll-target="#estimation-strategies-list">estimation-strategies-list</a></li>
  <li><a href="#eta-sq" id="toc-eta-sq" class="nav-link" data-scroll-target="#eta-sq">eta-sq</a></li>
  <li><a href="#extent" id="toc-extent" class="nav-link" data-scroll-target="#extent">extent</a></li>
  <li><a href="#f-test" id="toc-f-test" class="nav-link" data-scroll-target="#f-test">f-test</a></li>
  <li><a href="#fligner-killeen-test" id="toc-fligner-killeen-test" class="nav-link" data-scroll-target="#fligner-killeen-test">fligner-killeen-test</a></li>
  <li><a href="#freeman-tukey-test" id="toc-freeman-tukey-test" class="nav-link" data-scroll-target="#freeman-tukey-test">freeman-tukey-test</a></li>
  <li><a href="#geomean" id="toc-geomean" class="nav-link" data-scroll-target="#geomean">geomean</a></li>
  <li><a href="#glass-delta" id="toc-glass-delta" class="nav-link" data-scroll-target="#glass-delta">glass-delta</a></li>
  <li><a href="#harmean" id="toc-harmean" class="nav-link" data-scroll-target="#harmean">harmean</a></li>
  <li><a href="#hedges-g" id="toc-hedges-g" class="nav-link" data-scroll-target="#hedges-g">hedges-g</a></li>
  <li><a href="#hedges-g-1" id="toc-hedges-g-1" class="nav-link" data-scroll-target="#hedges-g-1">hedges-g*</a></li>
  <li><a href="#hedges-g-corrected" id="toc-hedges-g-corrected" class="nav-link" data-scroll-target="#hedges-g-corrected">hedges-g-corrected</a></li>
  <li><a href="#histogram" id="toc-histogram" class="nav-link" data-scroll-target="#histogram">histogram</a></li>
  <li><a href="#hpdi-extent" id="toc-hpdi-extent" class="nav-link" data-scroll-target="#hpdi-extent">hpdi-extent</a></li>
  <li><a href="#inner-fence-extent" id="toc-inner-fence-extent" class="nav-link" data-scroll-target="#inner-fence-extent">inner-fence-extent</a></li>
  <li><a href="#iqr" id="toc-iqr" class="nav-link" data-scroll-target="#iqr">iqr</a></li>
  <li><a href="#jarque-bera-test" id="toc-jarque-bera-test" class="nav-link" data-scroll-target="#jarque-bera-test">jarque-bera-test</a></li>
  <li><a href="#jensen-shannon-divergence-deprecated" id="toc-jensen-shannon-divergence-deprecated" class="nav-link" data-scroll-target="#jensen-shannon-divergence-deprecated">jensen-shannon-divergence <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#kendall-correlation" id="toc-kendall-correlation" class="nav-link" data-scroll-target="#kendall-correlation">kendall-correlation</a></li>
  <li><a href="#kruskal-test" id="toc-kruskal-test" class="nav-link" data-scroll-target="#kruskal-test">kruskal-test</a></li>
  <li><a href="#ks-test-one-sample" id="toc-ks-test-one-sample" class="nav-link" data-scroll-target="#ks-test-one-sample">ks-test-one-sample</a></li>
  <li><a href="#ks-test-two-samples" id="toc-ks-test-two-samples" class="nav-link" data-scroll-target="#ks-test-two-samples">ks-test-two-samples</a></li>
  <li><a href="#kullback-leibler-divergence-deprecated" id="toc-kullback-leibler-divergence-deprecated" class="nav-link" data-scroll-target="#kullback-leibler-divergence-deprecated">kullback-leibler-divergence <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#kurtosis" id="toc-kurtosis" class="nav-link" data-scroll-target="#kurtosis">kurtosis</a></li>
  <li><a href="#kurtosis-test" id="toc-kurtosis-test" class="nav-link" data-scroll-target="#kurtosis-test">kurtosis-test</a></li>
  <li><a href="#levene-test" id="toc-levene-test" class="nav-link" data-scroll-target="#levene-test">levene-test</a></li>
  <li><a href="#mad" id="toc-mad" class="nav-link" data-scroll-target="#mad">mad</a></li>
  <li><a href="#mad-extent" id="toc-mad-extent" class="nav-link" data-scroll-target="#mad-extent">mad-extent</a></li>
  <li><a href="#mae" id="toc-mae" class="nav-link" data-scroll-target="#mae">mae</a></li>
  <li><a href="#mape" id="toc-mape" class="nav-link" data-scroll-target="#mape">mape</a></li>
  <li><a href="#maximum" id="toc-maximum" class="nav-link" data-scroll-target="#maximum">maximum</a></li>
  <li><a href="#mcc" id="toc-mcc" class="nav-link" data-scroll-target="#mcc">mcc</a></li>
  <li><a href="#me" id="toc-me" class="nav-link" data-scroll-target="#me">me</a></li>
  <li><a href="#mean" id="toc-mean" class="nav-link" data-scroll-target="#mean">mean</a></li>
  <li><a href="#mean-absolute-deviation" id="toc-mean-absolute-deviation" class="nav-link" data-scroll-target="#mean-absolute-deviation">mean-absolute-deviation</a></li>
  <li><a href="#means-ratio" id="toc-means-ratio" class="nav-link" data-scroll-target="#means-ratio">means-ratio</a></li>
  <li><a href="#means-ratio-corrected" id="toc-means-ratio-corrected" class="nav-link" data-scroll-target="#means-ratio-corrected">means-ratio-corrected</a></li>
  <li><a href="#median" id="toc-median" class="nav-link" data-scroll-target="#median">median</a></li>
  <li><a href="#median-3" id="toc-median-3" class="nav-link" data-scroll-target="#median-3">median-3</a></li>
  <li><a href="#median-absolute-deviation" id="toc-median-absolute-deviation" class="nav-link" data-scroll-target="#median-absolute-deviation">median-absolute-deviation</a></li>
  <li><a href="#minimum" id="toc-minimum" class="nav-link" data-scroll-target="#minimum">minimum</a></li>
  <li><a href="#minimum-discrimination-information-test" id="toc-minimum-discrimination-information-test" class="nav-link" data-scroll-target="#minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
  <li><a href="#mode" id="toc-mode" class="nav-link" data-scroll-target="#mode">mode</a></li>
  <li><a href="#modes" id="toc-modes" class="nav-link" data-scroll-target="#modes">modes</a></li>
  <li><a href="#modified-power-transformation" id="toc-modified-power-transformation" class="nav-link" data-scroll-target="#modified-power-transformation">modified-power-transformation</a></li>
  <li><a href="#moment" id="toc-moment" class="nav-link" data-scroll-target="#moment">moment</a></li>
  <li><a href="#mse" id="toc-mse" class="nav-link" data-scroll-target="#mse">mse</a></li>
  <li><a href="#multinomial-likelihood-ratio-test" id="toc-multinomial-likelihood-ratio-test" class="nav-link" data-scroll-target="#multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
  <li><a href="#neyman-modified-chisq-test" id="toc-neyman-modified-chisq-test" class="nav-link" data-scroll-target="#neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
  <li><a href="#normality-test" id="toc-normality-test" class="nav-link" data-scroll-target="#normality-test">normality-test</a></li>
  <li><a href="#omega-sq" id="toc-omega-sq" class="nav-link" data-scroll-target="#omega-sq">omega-sq</a></li>
  <li><a href="#one-way-anova-test" id="toc-one-way-anova-test" class="nav-link" data-scroll-target="#one-way-anova-test">one-way-anova-test</a></li>
  <li><a href="#outer-fence-extent" id="toc-outer-fence-extent" class="nav-link" data-scroll-target="#outer-fence-extent">outer-fence-extent</a></li>
  <li><a href="#outliers" id="toc-outliers" class="nav-link" data-scroll-target="#outliers">outliers</a></li>
  <li><a href="#p-overlap" id="toc-p-overlap" class="nav-link" data-scroll-target="#p-overlap">p-overlap</a></li>
  <li><a href="#p-value" id="toc-p-value" class="nav-link" data-scroll-target="#p-value">p-value</a></li>
  <li><a href="#pacf" id="toc-pacf" class="nav-link" data-scroll-target="#pacf">pacf</a></li>
  <li><a href="#pacf-ci" id="toc-pacf-ci" class="nav-link" data-scroll-target="#pacf-ci">pacf-ci</a></li>
  <li><a href="#pearson-correlation" id="toc-pearson-correlation" class="nav-link" data-scroll-target="#pearson-correlation">pearson-correlation</a></li>
  <li><a href="#pearson-r" id="toc-pearson-r" class="nav-link" data-scroll-target="#pearson-r">pearson-r</a></li>
  <li><a href="#percentile" id="toc-percentile" class="nav-link" data-scroll-target="#percentile">percentile</a></li>
  <li><a href="#percentile-bc-extent" id="toc-percentile-bc-extent" class="nav-link" data-scroll-target="#percentile-bc-extent">percentile-bc-extent</a></li>
  <li><a href="#percentile-bca-extent" id="toc-percentile-bca-extent" class="nav-link" data-scroll-target="#percentile-bca-extent">percentile-bca-extent</a></li>
  <li><a href="#percentile-extent" id="toc-percentile-extent" class="nav-link" data-scroll-target="#percentile-extent">percentile-extent</a></li>
  <li><a href="#percentiles" id="toc-percentiles" class="nav-link" data-scroll-target="#percentiles">percentiles</a></li>
  <li><a href="#pi" id="toc-pi" class="nav-link" data-scroll-target="#pi">pi</a></li>
  <li><a href="#pi-extent" id="toc-pi-extent" class="nav-link" data-scroll-target="#pi-extent">pi-extent</a></li>
  <li><a href="#pooled-stddev" id="toc-pooled-stddev" class="nav-link" data-scroll-target="#pooled-stddev">pooled-stddev</a></li>
  <li><a href="#pooled-variance" id="toc-pooled-variance" class="nav-link" data-scroll-target="#pooled-variance">pooled-variance</a></li>
  <li><a href="#population-stddev" id="toc-population-stddev" class="nav-link" data-scroll-target="#population-stddev">population-stddev</a></li>
  <li><a href="#population-variance" id="toc-population-variance" class="nav-link" data-scroll-target="#population-variance">population-variance</a></li>
  <li><a href="#population-wstddev" id="toc-population-wstddev" class="nav-link" data-scroll-target="#population-wstddev">population-wstddev</a></li>
  <li><a href="#population-wvariance" id="toc-population-wvariance" class="nav-link" data-scroll-target="#population-wvariance">population-wvariance</a></li>
  <li><a href="#power-divergence-test" id="toc-power-divergence-test" class="nav-link" data-scroll-target="#power-divergence-test">power-divergence-test</a></li>
  <li><a href="#power-transformation" id="toc-power-transformation" class="nav-link" data-scroll-target="#power-transformation">power-transformation</a></li>
  <li><a href="#powmean" id="toc-powmean" class="nav-link" data-scroll-target="#powmean">powmean</a></li>
  <li><a href="#psnr" id="toc-psnr" class="nav-link" data-scroll-target="#psnr">psnr</a></li>
  <li><a href="#quantile" id="toc-quantile" class="nav-link" data-scroll-target="#quantile">quantile</a></li>
  <li><a href="#quantile-extent" id="toc-quantile-extent" class="nav-link" data-scroll-target="#quantile-extent">quantile-extent</a></li>
  <li><a href="#quantiles" id="toc-quantiles" class="nav-link" data-scroll-target="#quantiles">quantiles</a></li>
  <li><a href="#r2" id="toc-r2" class="nav-link" data-scroll-target="#r2">r2</a></li>
  <li><a href="#r2-determination" id="toc-r2-determination" class="nav-link" data-scroll-target="#r2-determination">r2-determination</a></li>
  <li><a href="#rank-epsilon-sq" id="toc-rank-epsilon-sq" class="nav-link" data-scroll-target="#rank-epsilon-sq">rank-epsilon-sq</a></li>
  <li><a href="#rank-eta-sq" id="toc-rank-eta-sq" class="nav-link" data-scroll-target="#rank-eta-sq">rank-eta-sq</a></li>
  <li><a href="#remove-outliers" id="toc-remove-outliers" class="nav-link" data-scroll-target="#remove-outliers">remove-outliers</a></li>
  <li><a href="#rescale" id="toc-rescale" class="nav-link" data-scroll-target="#rescale">rescale</a></li>
  <li><a href="#rmse" id="toc-rmse" class="nav-link" data-scroll-target="#rmse">rmse</a></li>
  <li><a href="#robust-standardize" id="toc-robust-standardize" class="nav-link" data-scroll-target="#robust-standardize">robust-standardize</a></li>
  <li><a href="#rows-contingency-table" id="toc-rows-contingency-table" class="nav-link" data-scroll-target="#rows-contingency-table">rows-&gt;contingency-table</a></li>
  <li><a href="#rss" id="toc-rss" class="nav-link" data-scroll-target="#rss">rss</a></li>
  <li><a href="#second-moment-deprecated" id="toc-second-moment-deprecated" class="nav-link" data-scroll-target="#second-moment-deprecated">second-moment <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#sem" id="toc-sem" class="nav-link" data-scroll-target="#sem">sem</a></li>
  <li><a href="#sem-extent" id="toc-sem-extent" class="nav-link" data-scroll-target="#sem-extent">sem-extent</a></li>
  <li><a href="#similarity" id="toc-similarity" class="nav-link" data-scroll-target="#similarity">similarity</a></li>
  <li><a href="#skewness" id="toc-skewness" class="nav-link" data-scroll-target="#skewness">skewness</a></li>
  <li><a href="#skewness-test" id="toc-skewness-test" class="nav-link" data-scroll-target="#skewness-test">skewness-test</a></li>
  <li><a href="#span" id="toc-span" class="nav-link" data-scroll-target="#span">span</a></li>
  <li><a href="#spearman-correlation" id="toc-spearman-correlation" class="nav-link" data-scroll-target="#spearman-correlation">spearman-correlation</a></li>
  <li><a href="#standardize" id="toc-standardize" class="nav-link" data-scroll-target="#standardize">standardize</a></li>
  <li><a href="#stats-map" id="toc-stats-map" class="nav-link" data-scroll-target="#stats-map">stats-map</a></li>
  <li><a href="#stddev" id="toc-stddev" class="nav-link" data-scroll-target="#stddev">stddev</a></li>
  <li><a href="#stddev-extent" id="toc-stddev-extent" class="nav-link" data-scroll-target="#stddev-extent">stddev-extent</a></li>
  <li><a href="#sum" id="toc-sum" class="nav-link" data-scroll-target="#sum">sum</a></li>
  <li><a href="#t-test-one-sample" id="toc-t-test-one-sample" class="nav-link" data-scroll-target="#t-test-one-sample">t-test-one-sample</a></li>
  <li><a href="#t-test-two-samples" id="toc-t-test-two-samples" class="nav-link" data-scroll-target="#t-test-two-samples">t-test-two-samples</a></li>
  <li><a href="#trim" id="toc-trim" class="nav-link" data-scroll-target="#trim">trim</a></li>
  <li><a href="#trim-lower" id="toc-trim-lower" class="nav-link" data-scroll-target="#trim-lower">trim-lower</a></li>
  <li><a href="#trim-upper" id="toc-trim-upper" class="nav-link" data-scroll-target="#trim-upper">trim-upper</a></li>
  <li><a href="#tschuprows-t" id="toc-tschuprows-t" class="nav-link" data-scroll-target="#tschuprows-t">tschuprows-t</a></li>
  <li><a href="#ttest-one-sample-deprecated" id="toc-ttest-one-sample-deprecated" class="nav-link" data-scroll-target="#ttest-one-sample-deprecated">ttest-one-sample <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#ttest-two-samples-deprecated" id="toc-ttest-two-samples-deprecated" class="nav-link" data-scroll-target="#ttest-two-samples-deprecated">ttest-two-samples <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#variance" id="toc-variance" class="nav-link" data-scroll-target="#variance">variance</a></li>
  <li><a href="#variation" id="toc-variation" class="nav-link" data-scroll-target="#variation">variation</a></li>
  <li><a href="#weighted-kappa" id="toc-weighted-kappa" class="nav-link" data-scroll-target="#weighted-kappa">weighted-kappa</a></li>
  <li><a href="#winsor" id="toc-winsor" class="nav-link" data-scroll-target="#winsor">winsor</a></li>
  <li><a href="#wmean-deprecated" id="toc-wmean-deprecated" class="nav-link" data-scroll-target="#wmean-deprecated">wmean <sup><sub>DEPRECATED</sub></sup></a></li>
  <li><a href="#wmedian" id="toc-wmedian" class="nav-link" data-scroll-target="#wmedian">wmedian</a></li>
  <li><a href="#wmw-odds" id="toc-wmw-odds" class="nav-link" data-scroll-target="#wmw-odds">wmw-odds</a></li>
  <li><a href="#wquantile" id="toc-wquantile" class="nav-link" data-scroll-target="#wquantile">wquantile</a></li>
  <li><a href="#wquantiles" id="toc-wquantiles" class="nav-link" data-scroll-target="#wquantiles">wquantiles</a></li>
  <li><a href="#wstddev" id="toc-wstddev" class="nav-link" data-scroll-target="#wstddev">wstddev</a></li>
  <li><a href="#wvariance" id="toc-wvariance" class="nav-link" data-scroll-target="#wvariance">wvariance</a></li>
  <li><a href="#yeo-johnson-transformation" id="toc-yeo-johnson-transformation" class="nav-link" data-scroll-target="#yeo-johnson-transformation">yeo-johnson-transformation</a></li>
  <li><a href="#z-test-one-sample" id="toc-z-test-one-sample" class="nav-link" data-scroll-target="#z-test-one-sample">z-test-one-sample</a></li>
  <li><a href="#z-test-two-samples" id="toc-z-test-two-samples" class="nav-link" data-scroll-target="#z-test-two-samples">z-test-two-samples</a></li>
  </ul></li>
  </ul></li>
  </ul>
</nav>
    </div>
<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Statistics</h1>
</div>



<div class="quarto-title-meta">

    
  
    
  </div>
  


</header>


<style></style>
<style>.printedClojure .sourceCode {
  background-color: transparent;
  border-style: none;
}
</style>
<style>.clay-limit-image-width .clay-image {max-width: 100%}
.clay-side-by-side .sourceCode {margin: 0}
.clay-side-by-side {margin: 1em 0}
</style>
<script src="stats_files/md-default0.js" type="text/javascript"></script>
<script src="stats_files/md-default1.js" type="text/javascript"></script>
<div class="sourceClojure">
<div class="sourceCode" id="cb1"><pre class="sourceCode clojure code-with-copy"><code class="sourceCode clojure"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>(<span class="kw">ns</span> stats</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>  (<span class="at">:require</span> [fastmath.stats <span class="at">:as</span> stats]</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a>            [fastmath.dev.codox <span class="at">:as</span> codox]))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<section id="reference" class="level2">
<h2 class="anchored" data-anchor-id="reference">Reference</h2>
<section id="fastmath.stats" class="level3">
<h3 class="anchored" data-anchor-id="fastmath.stats">fastmath.stats</h3>
<section id="statistics-functions." class="level4">
<h4 class="anchored" data-anchor-id="statistics-functions.">Statistics functions.</h4>
<ul>
<li>Descriptive statistics.</li>
<li>Correlation / covariance</li>
<li>Outliers</li>
<li>Confidence intervals</li>
<li>Extents</li>
<li>Effect size</li>
<li>Tests</li>
<li>Histogram</li>
<li>ACF/PACF</li>
<li>Bootstrap (see <code>fastmath.stats.bootstrap</code>)</li>
<li>Binary measures</li>
</ul>
<p>Functions are backed by Apache Commons Math or SMILE libraries. All work with Clojure sequences.</p>
<p>##### Descriptive statistics</p>
<p>All in one function <a href="#LOS-stats-map">stats-map</a> contains:</p>
<ul>
<li><code>:Size</code> - size of the samples, <code>(count ...)</code></li>
<li><code>:Min</code> - <a href="#LOS-minimum">minimum</a> value</li>
<li><code>:Max</code> - <a href="#LOS-maximum">maximum</a> value</li>
<li><code>:Range</code> - range of values</li>
<li><code>:Mean</code> - <a href="#LOS-mean">mean</a>/average</li>
<li><code>:Median</code> - <a href="#LOS-median">median</a>, see also: <a href="#LOS-median-3">median-3</a></li>
<li><code>:Mode</code> - <a href="#LOS-mode">mode</a>, see also: <a href="#LOS-modes">modes</a></li>
<li><code>:Q1</code> - first quartile, use: <a href="#LOS-percentile">percentile</a>, <a href="#LOS-quartile">quartile</a></li>
<li><code>:Q3</code> - third quartile, use: <a href="#LOS-percentile">percentile</a>, <a href="#LOS-quartile">quartile</a></li>
<li><code>:Total</code> - <a href="#LOS-sum">sum</a> of all samples</li>
<li><code>:SD</code> - sample standard deviation</li>
<li><code>:Variance</code> - variance</li>
<li><code>:MAD</code> - <a href="#LOS-median-absolute-deviation">median-absolute-deviation</a></li>
<li><code>:SEM</code> - standard error of mean</li>
<li><code>:LAV</code> - lower adjacent value, use: <a href="#LOS-adjacent-values">adjacent-values</a></li>
<li><code>:UAV</code> - upper adjacent value, use: <a href="#LOS-adjacent-values">adjacent-values</a></li>
<li><code>:IQR</code> - interquartile range, <code>(- q3 q1)</code></li>
<li><code>:LOF</code> - lower outer fence, <code>(- q1 (* 3.0 iqr))</code></li>
<li><code>:UOF</code> - upper outer fence, <code>(+ q3 (* 3.0 iqr))</code></li>
<li><code>:LIF</code> - lower inner fence, <code>(- q1 (* 1.5 iqr))</code></li>
<li><code>:UIF</code> - upper inner fence, <code>(+ q3 (* 1.5 iqr))</code></li>
<li><code>:Outliers</code> - list of <a href="#LOS-outliers">outliers</a>, samples which are outside outer fences</li>
<li><code>:Kurtosis</code> - <a href="#LOS-kurtosis">kurtosis</a></li>
<li><code>:Skewness</code> - <a href="#LOS-skewness">skewness</a></li>
</ul>
<p>Note: <a href="#LOS-percentile">percentile</a> and <a href="#LOS-quartile">quartile</a> can have 10 different interpolation strategies. See <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/rank/Percentile.html">docs</a></p>
<span id="#LOS-->confusion-matrix"></span>
</section>
<section id="confusion-matrix" class="level4">
<h4 class="anchored" data-anchor-id="confusion-matrix">-&gt;confusion-matrix</h4>
<ul>
<li><code>(-&gt;confusion-matrix tp fn fp tn)</code></li>
<li><code>(-&gt;confusion-matrix confusion-matrix)</code></li>
<li><code>(-&gt;confusion-matrix actual prediction)</code></li>
<li><code>(-&gt;confusion-matrix actual prediction encode-true)</code></li>
</ul>
<p>Convert input to confusion matrix</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2019">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-L0"></span>
</section>
<section id="l0" class="level4">
<h4 class="anchored" data-anchor-id="l0">L0</h4>
<p>Count equal values in both seqs. Same as <a href="#LOS-count==">count==</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1101">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-L1"></span>
</section>
<section id="l1" class="level4">
<h4 class="anchored" data-anchor-id="l1">L1</h4>
<ul>
<li><code>(L1 [vs1 vs2-or-val])</code></li>
<li><code>(L1 vs1 vs2-or-val)</code></li>
</ul>
<p>Manhattan distance</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1103">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-L2"></span>
</section>
<section id="l2" class="level4">
<h4 class="anchored" data-anchor-id="l2">L2</h4>
<ul>
<li><code>(L2 [vs1 vs2-or-val])</code></li>
<li><code>(L2 vs1 vs2-or-val)</code></li>
</ul>
<p>Euclidean distance</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1117">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-L2sq"></span>
</section>
<section id="l2sq" class="level4">
<h4 class="anchored" data-anchor-id="l2sq">L2sq</h4>
<ul>
<li><code>(L2sq [vs1 vs2-or-val])</code></li>
<li><code>(L2sq vs1 vs2-or-val)</code></li>
</ul>
<p>Squared euclidean distance</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1110">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-LInf"></span>
</section>
<section id="linf" class="level4">
<h4 class="anchored" data-anchor-id="linf">LInf</h4>
<ul>
<li><code>(LInf [vs1 vs2-or-val])</code></li>
<li><code>(LInf vs1 vs2-or-val)</code></li>
</ul>
<p>Chebyshev distance</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1124">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acf"></span>
</section>
<section id="acf" class="level4">
<h4 class="anchored" data-anchor-id="acf">acf</h4>
<ul>
<li><code>(acf data)</code></li>
<li><code>(acf data lags)</code></li>
</ul>
<p>Calculate acf (autocorrelation function) for given number of lags or a list of lags.</p>
<p>If lags is omitted function returns maximum possible number of lags.</p>
<p>See also <a href="#LOS-acf-ci">acf-ci</a>, <a href="#LOS-pacf">pacf</a>, <a href="#LOS-pacf-ci">pacf-ci</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2179">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-acf-ci"></span>
</section>
<section id="acf-ci" class="level4">
<h4 class="anchored" data-anchor-id="acf-ci">acf-ci</h4>
<ul>
<li><code>(acf-ci data)</code></li>
<li><code>(acf-ci data lags)</code></li>
<li><code>(acf-ci data lags alpha)</code></li>
</ul>
<p><a href="#LOS-acf">acf</a> with added confidence interval data.</p>
<p><code>:cis</code> contains list of calculated ci for every lag.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2238">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ad-test-one-sample"></span>
</section>
<section id="ad-test-one-sample" class="level4">
<h4 class="anchored" data-anchor-id="ad-test-one-sample">ad-test-one-sample</h4>
<ul>
<li><code>(ad-test-one-sample xs)</code></li>
<li><code>(ad-test-one-sample xs distribution-or-ys)</code></li>
<li><code>(ad-test-one-sample xs distribution-or-ys {:keys [sides kernel bandwidth], :or {sides :one-sided-greater, kernel :gaussian}})</code></li>
</ul>
<p>Anderson-Darling test</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3011">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-adjacent-values"></span>
</section>
<section id="adjacent-values" class="level4">
<h4 class="anchored" data-anchor-id="adjacent-values">adjacent-values</h4>
<ul>
<li><code>(adjacent-values vs)</code></li>
<li><code>(adjacent-values vs estimation-strategy)</code></li>
<li><code>(adjacent-values vs q1 q3 m)</code></li>
</ul>
<p>Lower and upper adjacent values (LAV and UAV).</p>
<p>Let Q1 is 25-percentile and Q3 is 75-percentile. IQR is <code>(- Q3 Q1)</code>.</p>
<ul>
<li>LAV is smallest value which is greater or equal to the LIF = <code>(- Q1 (* 1.5 IQR))</code>.</li>
<li>UAV is largest value which is lower or equal to the UIF = <code>(+ Q3 (* 1.5 IQR))</code>.</li>
<li>third value is a median of samples</li>
</ul>
<p>Optional <code>estimation-strategy</code> argument can be set to change quantile calculations estimation type. See <a href="#LOS-estimation-strategies">estimation-strategies</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L458">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ameasure"></span>
</section>
<section id="ameasure" class="level4">
<h4 class="anchored" data-anchor-id="ameasure">ameasure</h4>
<ul>
<li><code>(ameasure [group1 group2])</code></li>
<li><code>(ameasure group1 group2)</code></li>
</ul>
<p>Vargha-Delaney A measure for two populations a and b</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1597">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-binary-measures"></span>
</section>
<section id="binary-measures" class="level4">
<h4 class="anchored" data-anchor-id="binary-measures">binary-measures</h4>
<ul>
<li><code>(binary-measures tp fn fp tn)</code></li>
<li><code>(binary-measures confusion-matrix)</code></li>
<li><code>(binary-measures actual prediction)</code></li>
<li><code>(binary-measures actual prediction true-value)</code></li>
</ul>
<p>Subset of binary measures. See <a href="#LOS-binary-measures-all">binary-measures-all</a>.</p>
<p>Following keys are returned: <code>[:tp :tn :fp :fn :accuracy :fdr :f-measure :fall-out :precision :recall :sensitivity :specificity :prevalence]</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2061">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-binary-measures-all"></span>
</section>
<section id="binary-measures-all" class="level4">
<h4 class="anchored" data-anchor-id="binary-measures-all">binary-measures-all</h4>
<ul>
<li><code>(binary-measures-all tp fn fp tn)</code></li>
<li><code>(binary-measures-all confusion-matrix)</code></li>
<li><code>(binary-measures-all actual prediction)</code></li>
<li><code>(binary-measures-all actual prediction true-value)</code></li>
</ul>
<p>Collection of binary measures.</p>
<p>Arguments: * <code>confusion-matrix</code> - either map or sequence with <code>[:tp :fn :fp :tn]</code> values</p>
<p>or</p>
<ul>
<li><code>actual</code> - list of ground truth values</li>
<li><code>prediction</code> - list of predicted values</li>
<li><code>true-value</code> - optional, true/false encoding, what is true in <code>truth</code> and <code>prediction</code></li>
</ul>
<p><code>true-value</code> can be one of:</p>
<ul>
<li><code>nil</code> - values are treating as booleans</li>
<li>any sequence - values from sequence will be treated as <code>true</code></li>
<li>map - conversion will be done according to provided map (if there is no correspondin key, value is treated as <code>false</code>)</li>
<li>any predicate</li>
</ul>
<p>https://en.wikipedia.org/wiki/Precision_and_recall</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2029">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-binomial-ci"></span>
</section>
<section id="binomial-ci" class="level4">
<h4 class="anchored" data-anchor-id="binomial-ci">binomial-ci</h4>
<ul>
<li><code>(binomial-ci number-of-successes number-of-trials)</code></li>
<li><code>(binomial-ci number-of-successes number-of-trials method)</code></li>
<li><code>(binomial-ci number-of-successes number-of-trials method alpha)</code></li>
</ul>
<p>Return confidence interval for a binomial distribution.</p>
<p>Possible methods are: * <code>:asymptotic</code> (normal aproximation, based on central limit theorem), default * <code>:agresti-coull</code> * <code>:clopper-pearson</code> * <code>:wilson</code> * <code>:prop.test</code> - one sample proportion test * <code>:cloglog</code> * <code>:logit</code> * <code>:probit</code> * <code>:arcsine</code> * <code>:all</code> - apply all methods and return a map of triplets</p>
<p>Default alpha is 0.05</p>
<p>Returns a triple [lower ci, upper ci, p=successes/trials]</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2319">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-binomial-ci-methods"></span>
</section>
<section id="binomial-ci-methods" class="level4">
<h4 class="anchored" data-anchor-id="binomial-ci-methods">binomial-ci-methods</h4>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2316">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-binomial-test"></span>
</section>
<section id="binomial-test" class="level4">
<h4 class="anchored" data-anchor-id="binomial-test">binomial-test</h4>
<ul>
<li><code>(binomial-test xs)</code></li>
<li><code>(binomial-test xs maybe-params)</code></li>
<li><code>(binomial-test number-of-successes number-of-trials {:keys [alpha p ci-method sides], :or {alpha 0.05, p 0.5, ci-method :asymptotic, sides :two-sided}})</code></li>
</ul>
<p>Binomial test</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code> (default), <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
<li><code>ci-method</code> - see <a href="#LOS-binomial-ci-methods">binomial-ci-methods</a></li>
<li><code>p</code> - tested probability</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2541">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bootstrap"></span>
</section>
<section id="bootstrap-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="bootstrap-deprecated">bootstrap <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Please use fastmath.stats.bootstrap/bootstrap instead</em></p>
<ul>
<li><code>(bootstrap vs)</code></li>
<li><code>(bootstrap vs samples)</code></li>
<li><code>(bootstrap vs samples size)</code></li>
</ul>
<p>Generate set of samples of given size from provided data.</p>
<p>Default <code>samples</code> is 200, number of <code>size</code> defaults to sample size.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L851">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-bootstrap-ci"></span>
</section>
<section id="bootstrap-ci-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="bootstrap-ci-deprecated">bootstrap-ci <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Please use fastmath.stats.boostrap/ci-basic instead</em></p>
<ul>
<li><code>(bootstrap-ci vs)</code></li>
<li><code>(bootstrap-ci vs alpha)</code></li>
<li><code>(bootstrap-ci vs alpha samples)</code></li>
<li><code>(bootstrap-ci vs alpha samples stat-fn)</code></li>
</ul>
<p>Bootstrap method to calculate confidence interval.</p>
<p>Alpha defaults to 0.98, samples to 1000. Last parameter is statistical function used to measure, default: <a href="#LOS-mean">mean</a>.</p>
<p>Returns ci and statistical function value.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L830">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-brown-forsythe-test"></span>
</section>
<section id="brown-forsythe-test" class="level4">
<h4 class="anchored" data-anchor-id="brown-forsythe-test">brown-forsythe-test</h4>
<ul>
<li><code>(brown-forsythe-test xss)</code></li>
<li><code>(brown-forsythe-test xss params)</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2973">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-chisq-test"></span>
</section>
<section id="chisq-test" class="level4">
<h4 class="anchored" data-anchor-id="chisq-test">chisq-test</h4>
<ul>
<li><code>(chisq-test contingency-table-or-xs)</code></li>
<li><code>(chisq-test contingency-table-or-xs params)</code></li>
</ul>
<p>Chi square test, a power divergence test for <code>lambda</code> 1.0</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2888">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ci"></span>
</section>
<section id="ci" class="level4">
<h4 class="anchored" data-anchor-id="ci">ci</h4>
<ul>
<li><code>(ci vs)</code></li>
<li><code>(ci vs alpha)</code></li>
</ul>
<p>T-student based confidence interval for given data. Alpha value defaults to 0.05.</p>
<p>Last value is mean.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L815">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cliffs-delta"></span>
</section>
<section id="cliffs-delta" class="level4">
<h4 class="anchored" data-anchor-id="cliffs-delta">cliffs-delta</h4>
<ul>
<li><code>(cliffs-delta [group1 group2])</code></li>
<li><code>(cliffs-delta group1 group2)</code></li>
</ul>
<p>Cliff’s delta effect size for ordinal data.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1586">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-coefficient-matrix"></span>
</section>
<section id="coefficient-matrix" class="level4">
<h4 class="anchored" data-anchor-id="coefficient-matrix">coefficient-matrix</h4>
<ul>
<li><code>(coefficient-matrix vss)</code></li>
<li><code>(coefficient-matrix vss measure-fn)</code></li>
<li><code>(coefficient-matrix vss measure-fn symmetric?)</code></li>
</ul>
<p>Generate coefficient (correlation, covariance, any two arg function) matrix from seq of seqs. Row order.</p>
<p>Default method: pearson-correlation</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1000">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-d"></span>
</section>
<section id="cohens-d" class="level4">
<h4 class="anchored" data-anchor-id="cohens-d">cohens-d</h4>
<ul>
<li><code>(cohens-d [group1 group2])</code></li>
<li><code>(cohens-d group1 group2)</code></li>
<li><code>(cohens-d group1 group2 method)</code></li>
</ul>
<p>Cohen’s d effect size for two groups</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1505">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-d-corrected"></span>
</section>
<section id="cohens-d-corrected" class="level4">
<h4 class="anchored" data-anchor-id="cohens-d-corrected">cohens-d-corrected</h4>
<ul>
<li><code>(cohens-d-corrected [group1 group2])</code></li>
<li><code>(cohens-d-corrected group1 group2)</code></li>
<li><code>(cohens-d-corrected group1 group2 method)</code></li>
</ul>
<p>Cohen’s d corrected for small group size</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1519">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-f"></span>
</section>
<section id="cohens-f" class="level4">
<h4 class="anchored" data-anchor-id="cohens-f">cohens-f</h4>
<ul>
<li><code>(cohens-f [group1 group2])</code></li>
<li><code>(cohens-f group1 group2)</code></li>
<li><code>(cohens-f group1 group2 type)</code></li>
</ul>
<p>Cohens f, sqrt of Cohens f2.</p>
<p>Possible <code>type</code> values are: <code>:eta</code> (default), <code>:omega</code> and <code>:epsilon</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1729">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-f2"></span>
</section>
<section id="cohens-f2" class="level4">
<h4 class="anchored" data-anchor-id="cohens-f2">cohens-f2</h4>
<ul>
<li><code>(cohens-f2 [group1 group2])</code></li>
<li><code>(cohens-f2 group1 group2)</code></li>
<li><code>(cohens-f2 group1 group2 type)</code></li>
</ul>
<p>Cohens f2, by default based on <code>eta-sq</code>.</p>
<p>Possible <code>type</code> values are: <code>:eta</code> (default), <code>:omega</code> and <code>:epsilon</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1715">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-kappa"></span>
</section>
<section id="cohens-kappa" class="level4">
<h4 class="anchored" data-anchor-id="cohens-kappa">cohens-kappa</h4>
<ul>
<li><code>(cohens-kappa group1 group2)</code></li>
<li><code>(cohens-kappa contingency-table)</code></li>
</ul>
<p>Cohens kappa</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1863">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-q"></span>
</section>
<section id="cohens-q" class="level4">
<h4 class="anchored" data-anchor-id="cohens-q">cohens-q</h4>
<ul>
<li><code>(cohens-q r1 r2)</code></li>
<li><code>(cohens-q group1 group2a group2b)</code></li>
<li><code>(cohens-q group1a group2a group1b group2b)</code></li>
</ul>
<p>Comparison of two correlations.</p>
<p>Arity:</p>
<ul>
<li>2 - compare two correlation values</li>
<li>3 - compare correlation of <code>group1</code> and <code>group2a</code> with correlation of <code>group1</code> and <code>group2b</code></li>
<li>4 - compare correlation of first two arguments with correlation of last two arguments</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1737">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-u2"></span>
</section>
<section id="cohens-u2" class="level4">
<h4 class="anchored" data-anchor-id="cohens-u2">cohens-u2</h4>
<ul>
<li><code>(cohens-u2 [group1 group2])</code></li>
<li><code>(cohens-u2 group1 group2)</code></li>
<li><code>(cohens-u2 group1 group2 estimation-strategy)</code></li>
</ul>
<p>Cohen’s U2, the proportion of one of the groups that exceeds the same proportion in the other group.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1641">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-u3"></span>
</section>
<section id="cohens-u3" class="level4">
<h4 class="anchored" data-anchor-id="cohens-u3">cohens-u3</h4>
<ul>
<li><code>(cohens-u3 [group1 group2])</code></li>
<li><code>(cohens-u3 group1 group2)</code></li>
<li><code>(cohens-u3 group1 group2 estimation-strategy)</code></li>
</ul>
<p>Cohen’s U3, the proportion of the second group that is smaller than the median of the first group.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1658">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cohens-w"></span>
</section>
<section id="cohens-w" class="level4">
<h4 class="anchored" data-anchor-id="cohens-w">cohens-w</h4>
<ul>
<li><code>(cohens-w group1 group2)</code></li>
<li><code>(cohens-w contingency-table)</code></li>
</ul>
<p>Cohen’s W effect size for discrete data.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1848">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-contingency-2x2-measures"></span>
</section>
<section id="contingency-2x2-measures" class="level4">
<h4 class="anchored" data-anchor-id="contingency-2x2-measures">contingency-2x2-measures</h4>
<ul>
<li><code>(contingency-2x2-measures &amp; args)</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2166">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-contingency-2x2-measures-all"></span>
</section>
<section id="contingency-2x2-measures-all" class="level4">
<h4 class="anchored" data-anchor-id="contingency-2x2-measures-all">contingency-2x2-measures-all</h4>
<ul>
<li><code>(contingency-2x2-measures-all a b c d)</code></li>
<li><code>(contingency-2x2-measures-all map-or-seq)</code></li>
<li><code>(contingency-2x2-measures-all [a b] [c d])</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2157">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-contingency-table"></span>
</section>
<section id="contingency-table" class="level4">
<h4 class="anchored" data-anchor-id="contingency-table">contingency-table</h4>
<ul>
<li><code>(contingency-table &amp; seqs)</code></li>
</ul>
<p>Returns frequencies map of tuples built from seqs.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1771">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-contingency-table->marginals"></span>
</section>
<section id="contingency-table-marginals" class="level4">
<h4 class="anchored" data-anchor-id="contingency-table-marginals">contingency-table-&gt;marginals</h4>
<ul>
<li><code>(contingency-table-&gt;marginals ct)</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1792">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-correlation"></span>
</section>
<section id="correlation" class="level4">
<h4 class="anchored" data-anchor-id="correlation">correlation</h4>
<ul>
<li><code>(correlation [vs1 vs2])</code></li>
<li><code>(correlation vs1 vs2)</code></li>
</ul>
<p>Correlation of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L952">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-correlation-matrix"></span>
</section>
<section id="correlation-matrix" class="level4">
<h4 class="anchored" data-anchor-id="correlation-matrix">correlation-matrix</h4>
<ul>
<li><code>(correlation-matrix vss)</code></li>
<li><code>(correlation-matrix vss measure)</code></li>
</ul>
<p>Generate correlation matrix from seq of seqs. Row order.</p>
<p>Possible measures: <code>:pearson</code> (default), <code>:kendall</code>, <code>:spearman</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1022">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-count="></span>
</section>
<section id="count" class="level4">
<h4 class="anchored" data-anchor-id="count">count=</h4>
<ul>
<li><code>(count= [vs1 vs2-or-val])</code></li>
<li><code>(count= vs1 vs2-or-val)</code></li>
</ul>
<p>Count equal values in both seqs. Same as <a href="#LOS-L0">L0</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1094">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-covariance"></span>
</section>
<section id="covariance" class="level4">
<h4 class="anchored" data-anchor-id="covariance">covariance</h4>
<ul>
<li><code>(covariance [vs1 vs2])</code></li>
<li><code>(covariance vs1 vs2)</code></li>
</ul>
<p>Covariance of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L942">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-covariance-matrix"></span>
</section>
<section id="covariance-matrix" class="level4">
<h4 class="anchored" data-anchor-id="covariance-matrix">covariance-matrix</h4>
<ul>
<li><code>(covariance-matrix vss)</code></li>
</ul>
<p>Generate covariance matrix from seq of seqs. Row order.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1033">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cramers-c"></span>
</section>
<section id="cramers-c" class="level4">
<h4 class="anchored" data-anchor-id="cramers-c">cramers-c</h4>
<ul>
<li><code>(cramers-c group1 group2)</code></li>
<li><code>(cramers-c contingency-table)</code></li>
</ul>
<p>Cramer’s C effect size for discrete data.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1819">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cramers-v"></span>
</section>
<section id="cramers-v" class="level4">
<h4 class="anchored" data-anchor-id="cramers-v">cramers-v</h4>
<ul>
<li><code>(cramers-v group1 group2)</code></li>
<li><code>(cramers-v contingency-table)</code></li>
</ul>
<p>Cramer’s V effect size for discrete data.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1826">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cramers-v-corrected"></span>
</section>
<section id="cramers-v-corrected" class="level4">
<h4 class="anchored" data-anchor-id="cramers-v-corrected">cramers-v-corrected</h4>
<ul>
<li><code>(cramers-v-corrected group1 group2)</code></li>
<li><code>(cramers-v-corrected contingency-table)</code></li>
</ul>
<p>Corrected Cramer’s V</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1834">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-cressie-read-test"></span>
</section>
<section id="cressie-read-test" class="level4">
<h4 class="anchored" data-anchor-id="cressie-read-test">cressie-read-test</h4>
<ul>
<li><code>(cressie-read-test contingency-table-or-xs)</code></li>
<li><code>(cressie-read-test contingency-table-or-xs params)</code></li>
</ul>
<p>Cressie-Read test, a power divergence test for <code>lambda</code> 2/3</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2918">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-demean"></span>
</section>
<section id="demean" class="level4">
<h4 class="anchored" data-anchor-id="demean">demean</h4>
<ul>
<li><code>(demean vs)</code></li>
</ul>
<p>Subtract mean from sequence</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L925">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-dissimilarity"></span>
</section>
<section id="dissimilarity" class="level4">
<h4 class="anchored" data-anchor-id="dissimilarity">dissimilarity</h4>
<ul>
<li><code>(dissimilarity method P-observed Q-expected)</code></li>
<li><code>(dissimilarity method P-observed Q-expected {:keys [bins probabilities? epsilon log-base power remove-zeros?], :or {probabilities? true, epsilon 1.0E-6, log-base m/E, power 2.0}})</code></li>
</ul>
<p>Various PDF distance between two histograms (frequencies) or probabilities.</p>
<p>Q can be a distribution object. Then, histogram will be created out of P.</p>
<p>Arguments:</p>
<ul>
<li><code>method</code> - distance method</li>
<li><code>P-observed</code> - frequencies, probabilities or actual data (when Q is a distribution of <code>:bins</code> is set)</li>
<li><code>Q-expected</code> - frequencies, probabilities or distribution object (when P is a data or <code>:bins</code> is set)</li>
</ul>
<p>Options:</p>
<ul>
<li><code>:probabilities?</code> - should P/Q be converted to a probabilities, default: <code>true</code>.</li>
<li><code>:epsilon</code> - small number which replaces <code>0.0</code> when division or logarithm is used`</li>
<li><code>:log-base</code> - base for logarithms, default: <code>e</code></li>
<li><code>:power</code> - exponent for <code>:minkowski</code> distance, default: <code>2.0</code></li>
<li><code>:bins</code> - number of bins or bins estimation method, see <a href="#LOS-histogram">histogram</a>.</li>
</ul>
<p>The list of methods: <code>:euclidean</code>, <code>:city-block</code>, <code>:manhattan</code>, <code>:chebyshev</code>, <code>:minkowski</code>, <code>:sorensen</code>, <code>:gower</code>, <code>:soergel</code>, <code>:kulczynski</code>, <code>:canberra</code>, <code>:lorentzian</code>, <code>:non-intersection</code>, <code>:wave-hedges</code>, <code>:czekanowski</code>, <code>:motyka</code>, <code>:tanimoto</code>, <code>:jaccard</code>, <code>:dice</code>, <code>:bhattacharyya</code>, <code>:hellinger</code>, <code>:matusita</code>, <code>:squared-chord</code>, <code>:euclidean-sq</code>, <code>:squared-euclidean</code>, <code>:pearson-chisq</code>, <code>:chisq</code>, <code>:neyman-chisq</code>, <code>:squared-chisq</code>, <code>:symmetric-chisq</code>, <code>:divergence</code>, <code>:clark</code>, <code>:additive-symmetric-chisq</code>, <code>:kullback-leibler</code>, <code>:jeffreys</code>, <code>:k-divergence</code>, <code>:topsoe</code>, <code>:jensen-shannon</code>, <code>:jensen-difference</code>, <code>:taneja</code>, <code>:kumar-johnson</code>, <code>:avg</code></p>
<p>See more: Comprehensive Survey on Distance/Similarity Measures between Probability Density Functions by Sung-Hyuk Cha</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1325">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-durbin-watson"></span>
</section>
<section id="durbin-watson" class="level4">
<h4 class="anchored" data-anchor-id="durbin-watson">durbin-watson</h4>
<ul>
<li><code>(durbin-watson rs)</code></li>
</ul>
<p>Lag-1 Autocorrelation test for residuals</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1903">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-epsilon-sq"></span>
</section>
<section id="epsilon-sq" class="level4">
<h4 class="anchored" data-anchor-id="epsilon-sq">epsilon-sq</h4>
<ul>
<li><code>(epsilon-sq [group1 group2])</code></li>
<li><code>(epsilon-sq group1 group2)</code></li>
</ul>
<p>Less biased R2</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1707">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-estimate-bins"></span>
</section>
<section id="estimate-bins" class="level4">
<h4 class="anchored" data-anchor-id="estimate-bins">estimate-bins</h4>
<ul>
<li><code>(estimate-bins vs)</code></li>
<li><code>(estimate-bins vs bins-or-estimate-method)</code></li>
</ul>
<p>Estimate number of bins for histogram.</p>
<p>Possible methods are: <code>:sqrt</code> <code>:sturges</code> <code>:rice</code> <code>:doane</code> <code>:scott</code> <code>:freedman-diaconis</code> (default).</p>
<p>The number returned is not higher than number of samples.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1153">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-estimation-strategies-list"></span>
</section>
<section id="estimation-strategies-list" class="level4">
<h4 class="anchored" data-anchor-id="estimation-strategies-list">estimation-strategies-list</h4>
<p>List of estimation strategies for <a href="#LOS-percentile">percentile</a>/<a href="#LOS-quantile">quantile</a> functions.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L71">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-eta-sq"></span>
</section>
<section id="eta-sq" class="level4">
<h4 class="anchored" data-anchor-id="eta-sq">eta-sq</h4>
<ul>
<li><code>(eta-sq [group1 group2])</code></li>
<li><code>(eta-sq group1 group2)</code></li>
</ul>
<p>R2, coefficient of determination</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1687">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-extent"></span>
</section>
<section id="extent" class="level4">
<h4 class="anchored" data-anchor-id="extent">extent</h4>
<ul>
<li><code>(extent vs)</code></li>
</ul>
<p>Return extent (min, max, mean) values from sequence</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L625">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-f-test"></span>
</section>
<section id="f-test" class="level4">
<h4 class="anchored" data-anchor-id="f-test">f-test</h4>
<ul>
<li><code>(f-test xs ys)</code></li>
<li><code>(f-test xs ys {:keys [sides alpha], :or {sides :two-sided, alpha 0.05}})</code></li>
</ul>
<p>Variance F-test of two samples.</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code> (default), <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2744">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-fligner-killeen-test"></span>
</section>
<section id="fligner-killeen-test" class="level4">
<h4 class="anchored" data-anchor-id="fligner-killeen-test">fligner-killeen-test</h4>
<ul>
<li><code>(fligner-killeen-test xss)</code></li>
<li><code>(fligner-killeen-test xss {:keys [sides], :or {sides :one-sided-greater}})</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2977">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-freeman-tukey-test"></span>
</section>
<section id="freeman-tukey-test" class="level4">
<h4 class="anchored" data-anchor-id="freeman-tukey-test">freeman-tukey-test</h4>
<ul>
<li><code>(freeman-tukey-test contingency-table-or-xs)</code></li>
<li><code>(freeman-tukey-test contingency-table-or-xs params)</code></li>
</ul>
<p>Freeman-Tukey test, a power divergence test for <code>lambda</code> -0.5</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2912">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-geomean"></span>
</section>
<section id="geomean" class="level4">
<h4 class="anchored" data-anchor-id="geomean">geomean</h4>
<ul>
<li><code>(geomean vs)</code></li>
<li><code>(geomean vs weights)</code></li>
</ul>
<p>Geometric mean for positive values only with optional <code>weights</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L230">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-glass-delta"></span>
</section>
<section id="glass-delta" class="level4">
<h4 class="anchored" data-anchor-id="glass-delta">glass-delta</h4>
<ul>
<li><code>(glass-delta [group1 group2])</code></li>
<li><code>(glass-delta group1 group2)</code></li>
</ul>
<p>Glass’s delta effect size for two groups</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1554">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-harmean"></span>
</section>
<section id="harmean" class="level4">
<h4 class="anchored" data-anchor-id="harmean">harmean</h4>
<ul>
<li><code>(harmean vs)</code></li>
<li><code>(harmean vs weights)</code></li>
</ul>
<p>Harmonic mean with optional <code>weights</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L235">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hedges-g"></span>
</section>
<section id="hedges-g" class="level4">
<h4 class="anchored" data-anchor-id="hedges-g">hedges-g</h4>
<ul>
<li><code>(hedges-g [group1 group2])</code></li>
<li><code>(hedges-g group1 group2)</code></li>
</ul>
<p>Hedges’s g effect size for two groups</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1531">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hedges-g*"></span>
</section>
<section id="hedges-g-1" class="level4">
<h4 class="anchored" data-anchor-id="hedges-g-1">hedges-g*</h4>
<ul>
<li><code>(hedges-g* [group1 group2])</code></li>
<li><code>(hedges-g* group1 group2)</code></li>
</ul>
<p>Less biased Hedges’s g effect size for two groups, J term correction.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1543">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hedges-g-corrected"></span>
</section>
<section id="hedges-g-corrected" class="level4">
<h4 class="anchored" data-anchor-id="hedges-g-corrected">hedges-g-corrected</h4>
<ul>
<li><code>(hedges-g-corrected [group1 group2])</code></li>
<li><code>(hedges-g-corrected group1 group2)</code></li>
</ul>
<p>Cohen’s d corrected for small group size</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1537">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-histogram"></span>
</section>
<section id="histogram" class="level4">
<h4 class="anchored" data-anchor-id="histogram">histogram</h4>
<ul>
<li><code>(histogram vs)</code></li>
<li><code>(histogram vs bins-or-estimate-method)</code></li>
<li><code>(histogram vs bins-or-estimate-method [mn mx])</code></li>
<li><code>(histogram vs bins-or-estimate-method mn mx)</code></li>
</ul>
<p>Calculate histogram.</p>
<p>Estimation method can be a number, named method: <code>:sqrt</code> <code>:sturges</code> <code>:rice</code> <code>:doane</code> <code>:scott</code> <code>:freedman-diaconis</code> (default) or a sequence of points used as intervals. In the latter case or when <code>mn</code> and <code>mx</code> values are provided - data will be filtered to fit in desired interval(s).</p>
<p>Returns map with keys:</p>
<ul>
<li><code>:size</code> - number of bins</li>
<li><code>:step</code> - average distance between bins</li>
<li><code>:bins</code> - seq of pairs of range lower value and number of elements</li>
<li><code>:min</code> - min value</li>
<li><code>:max</code> - max value</li>
<li><code>:samples</code> - number of used samples</li>
<li><code>:frequencies</code> - a map containing counts for bin’s average</li>
<li><code>:intervals</code> - intervals used to create bins</li>
<li><code>:bins-maps</code> - seq of maps containing:
<ul>
<li><code>:min</code> - lower bound</li>
<li><code>:max</code> - upper bound</li>
<li><code>:step</code> - actual distance between bins</li>
<li><code>:count</code> - number of elements</li>
<li><code>:avg</code> - average value</li>
<li><code>:probability</code> - probability for bin</li>
</ul></li>
</ul>
<p>If difference between min and max values is <code>0</code>, number of bins is set to 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1228">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-hpdi-extent"></span>
</section>
<section id="hpdi-extent" class="level4">
<h4 class="anchored" data-anchor-id="hpdi-extent">hpdi-extent</h4>
<ul>
<li><code>(hpdi-extent vs)</code></li>
<li><code>(hpdi-extent vs size)</code></li>
</ul>
<p>Higher Posterior Density interval + median.</p>
<p><code>size</code> parameter is the target probability content of the interval.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L429">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-inner-fence-extent"></span>
</section>
<section id="inner-fence-extent" class="level4">
<h4 class="anchored" data-anchor-id="inner-fence-extent">inner-fence-extent</h4>
<ul>
<li><code>(inner-fence-extent vs)</code></li>
<li><code>(inner-fence-extent vs estimation-strategy)</code></li>
</ul>
<p>Returns LIF, UIF and median</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L485">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-iqr"></span>
</section>
<section id="iqr" class="level4">
<h4 class="anchored" data-anchor-id="iqr">iqr</h4>
<ul>
<li><code>(iqr vs)</code></li>
<li><code>(iqr vs estimation-strategy)</code></li>
</ul>
<p>Interquartile range.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L451">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-jarque-bera-test"></span>
</section>
<section id="jarque-bera-test" class="level4">
<h4 class="anchored" data-anchor-id="jarque-bera-test">jarque-bera-test</h4>
<ul>
<li><code>(jarque-bera-test xs)</code></li>
<li><code>(jarque-bera-test xs params)</code></li>
<li><code>(jarque-bera-test xs skew kurt {:keys [sides], :or {sides :one-sided-greater}})</code></li>
</ul>
<p>Goodness of fit test whether skewness and kurtosis of data match normal distribution</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2526">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-jensen-shannon-divergence"></span>
</section>
<section id="jensen-shannon-divergence-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="jensen-shannon-divergence-deprecated">jensen-shannon-divergence <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <a href="#LOS-dissimilarity">dissimilarity</a>.</em></p>
<ul>
<li><code>(jensen-shannon-divergence [vs1 vs2])</code></li>
<li><code>(jensen-shannon-divergence vs1 vs2)</code></li>
</ul>
<p>Jensen-Shannon divergence of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L992">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kendall-correlation"></span>
</section>
<section id="kendall-correlation" class="level4">
<h4 class="anchored" data-anchor-id="kendall-correlation">kendall-correlation</h4>
<ul>
<li><code>(kendall-correlation [vs1 vs2])</code></li>
<li><code>(kendall-correlation vs1 vs2)</code></li>
</ul>
<p>Kendall’s correlation of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L977">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kruskal-test"></span>
</section>
<section id="kruskal-test" class="level4">
<h4 class="anchored" data-anchor-id="kruskal-test">kruskal-test</h4>
<ul>
<li><code>(kruskal-test xss)</code></li>
<li><code>(kruskal-test xss {:keys [sides], :or {sides :right}})</code></li>
</ul>
<p>Kruskal-Wallis rank sum test.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3079">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ks-test-one-sample"></span>
</section>
<section id="ks-test-one-sample" class="level4">
<h4 class="anchored" data-anchor-id="ks-test-one-sample">ks-test-one-sample</h4>
<ul>
<li><code>(ks-test-one-sample xs)</code></li>
<li><code>(ks-test-one-sample xs distribution-or-ys)</code></li>
<li><code>(ks-test-one-sample xs distribution-or-ys {:keys [sides kernel bandwidth distinct?], :or {sides :two-sided, kernel :gaussian, distinct? true}})</code></li>
</ul>
<p>One sample Kolmogorov-Smirnov test</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3028">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ks-test-two-samples"></span>
</section>
<section id="ks-test-two-samples" class="level4">
<h4 class="anchored" data-anchor-id="ks-test-two-samples">ks-test-two-samples</h4>
<ul>
<li><code>(ks-test-two-samples xs ys)</code></li>
<li><code>(ks-test-two-samples xs ys {:keys [sides distinct?], :or {sides :two-sided, distinct? true}})</code></li>
</ul>
<p>Two samples Kolmogorov-Smirnov test</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3054">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kullback-leibler-divergence"></span>
</section>
<section id="kullback-leibler-divergence-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="kullback-leibler-divergence-deprecated">kullback-leibler-divergence <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <a href="#LOS-dissimilarity">dissimilarity</a>.</em></p>
<ul>
<li><code>(kullback-leibler-divergence [vs1 vs2])</code></li>
<li><code>(kullback-leibler-divergence vs1 vs2)</code></li>
</ul>
<p>Kullback-Leibler divergence of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L983">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kurtosis"></span>
</section>
<section id="kurtosis" class="level4">
<h4 class="anchored" data-anchor-id="kurtosis">kurtosis</h4>
<ul>
<li><code>(kurtosis vs)</code></li>
<li><code>(kurtosis vs typ)</code></li>
</ul>
<p>Calculate kurtosis from sequence.</p>
<p>Possible typs: <code>:G2</code> (default), <code>:g2</code> (or <code>:excess</code>), <code>:geary</code>, ,<code>:crow</code>, <code>:moors</code>, <code>:hogg</code> or <code>:kurt</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L788">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-kurtosis-test"></span>
</section>
<section id="kurtosis-test" class="level4">
<h4 class="anchored" data-anchor-id="kurtosis-test">kurtosis-test</h4>
<ul>
<li><code>(kurtosis-test xs)</code></li>
<li><code>(kurtosis-test xs params)</code></li>
<li><code>(kurtosis-test xs kurt {:keys [sides type], :or {sides :two-sided, type :kurt}})</code></li>
</ul>
<p>Normality test for kurtosis</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2483">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-levene-test"></span>
</section>
<section id="levene-test" class="level4">
<h4 class="anchored" data-anchor-id="levene-test">levene-test</h4>
<ul>
<li><code>(levene-test xss)</code></li>
<li><code>(levene-test xss {:keys [sides statistic scorediff], :or {sides :one-sided-greater, statistic mean, scorediff abs}})</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2962">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mad"></span>
</section>
<section id="mad" class="level4">
<h4 class="anchored" data-anchor-id="mad">mad</h4>
<p>Alias for <a href="#LOS-median-absolute-deviation">median-absolute-deviation</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L349">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mad-extent"></span>
</section>
<section id="mad-extent" class="level4">
<h4 class="anchored" data-anchor-id="mad-extent">mad-extent</h4>
<ul>
<li><code>(mad-extent vs)</code></li>
</ul>
<p>-/+ median-absolute-deviation and median</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L376">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mae"></span>
</section>
<section id="mae" class="level4">
<h4 class="anchored" data-anchor-id="mae">mae</h4>
<ul>
<li><code>(mae [vs1 vs2-or-val])</code></li>
<li><code>(mae vs1 vs2-or-val)</code></li>
</ul>
<p>Mean absolute error</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1046">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mape"></span>
</section>
<section id="mape" class="level4">
<h4 class="anchored" data-anchor-id="mape">mape</h4>
<ul>
<li><code>(mape [vs1 vs2-or-val])</code></li>
<li><code>(mape vs1 vs2-or-val)</code></li>
</ul>
<p>Mean absolute percentage error</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1053">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-maximum"></span>
</section>
<section id="maximum" class="level4">
<h4 class="anchored" data-anchor-id="maximum">maximum</h4>
<ul>
<li><code>(maximum vs)</code></li>
</ul>
<p>Maximum value from sequence.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L612">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mcc"></span>
</section>
<section id="mcc" class="level4">
<h4 class="anchored" data-anchor-id="mcc">mcc</h4>
<ul>
<li><code>(mcc group1 group2)</code></li>
<li><code>(mcc ct)</code></li>
</ul>
<p>Matthews correlation coefficient also known as phi coefficient.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1804">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-me"></span>
</section>
<section id="me" class="level4">
<h4 class="anchored" data-anchor-id="me">me</h4>
<ul>
<li><code>(me [vs1 vs2-or-val])</code></li>
<li><code>(me vs1 vs2-or-val)</code></li>
</ul>
<p>Mean error</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1039">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mean"></span>
</section>
<section id="mean" class="level4">
<h4 class="anchored" data-anchor-id="mean">mean</h4>
<ul>
<li><code>(mean vs)</code></li>
<li><code>(mean vs weights)</code></li>
</ul>
<p>Calculate mean of <code>vs</code> with optional <code>weights</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L225">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mean-absolute-deviation"></span>
</section>
<section id="mean-absolute-deviation" class="level4">
<h4 class="anchored" data-anchor-id="mean-absolute-deviation">mean-absolute-deviation</h4>
<ul>
<li><code>(mean-absolute-deviation vs)</code></li>
<li><code>(mean-absolute-deviation vs center)</code></li>
</ul>
<p>Calculate mean absolute deviation</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L352">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-means-ratio"></span>
</section>
<section id="means-ratio" class="level4">
<h4 class="anchored" data-anchor-id="means-ratio">means-ratio</h4>
<ul>
<li><code>(means-ratio [group1 group2])</code></li>
<li><code>(means-ratio group1 group2)</code></li>
<li><code>(means-ratio group1 group2 adjusted?)</code></li>
</ul>
<p>Means ratio</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1561">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-means-ratio-corrected"></span>
</section>
<section id="means-ratio-corrected" class="level4">
<h4 class="anchored" data-anchor-id="means-ratio-corrected">means-ratio-corrected</h4>
<ul>
<li><code>(means-ratio-corrected [group1 group2])</code></li>
<li><code>(means-ratio-corrected group1 group2)</code></li>
</ul>
<p>Bias correced means ratio</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1580">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-median"></span>
</section>
<section id="median" class="level4">
<h4 class="anchored" data-anchor-id="median">median</h4>
<ul>
<li><code>(median vs estimation-strategy)</code></li>
<li><code>(median vs)</code></li>
</ul>
<p>Calculate median of <code>vs</code>. See <a href="#LOS-median-3">median-3</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L213">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-median-3"></span>
</section>
<section id="median-3" class="level4">
<h4 class="anchored" data-anchor-id="median-3">median-3</h4>
<ul>
<li><code>(median-3 a b c)</code></li>
</ul>
<p>Median of three values. See <a href="#LOS-median">median</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L220">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-median-absolute-deviation"></span>
</section>
<section id="median-absolute-deviation" class="level4">
<h4 class="anchored" data-anchor-id="median-absolute-deviation">median-absolute-deviation</h4>
<ul>
<li><code>(median-absolute-deviation vs)</code></li>
<li><code>(median-absolute-deviation vs center)</code></li>
<li><code>(median-absolute-deviation vs center estimation-strategy)</code></li>
</ul>
<p>Calculate MAD</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L339">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-minimum"></span>
</section>
<section id="minimum" class="level4">
<h4 class="anchored" data-anchor-id="minimum">minimum</h4>
<ul>
<li><code>(minimum vs)</code></li>
</ul>
<p>Minimum value from sequence.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L605">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-minimum-discrimination-information-test"></span>
</section>
<section id="minimum-discrimination-information-test" class="level4">
<h4 class="anchored" data-anchor-id="minimum-discrimination-information-test">minimum-discrimination-information-test</h4>
<ul>
<li><code>(minimum-discrimination-information-test contingency-table-or-xs)</code></li>
<li><code>(minimum-discrimination-information-test contingency-table-or-xs params)</code></li>
</ul>
<p>Minimum discrimination information test, a power divergence test for <code>lambda</code> -1.0</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2900">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mode"></span>
</section>
<section id="mode" class="level4">
<h4 class="anchored" data-anchor-id="mode">mode</h4>
<ul>
<li><code>(mode vs method)</code></li>
<li><code>(mode vs method opts)</code></li>
<li><code>(mode vs)</code></li>
</ul>
<p>Find the value that appears most often in a dataset <code>vs</code>.</p>
<p>For sample from continuous distribution, three algorithms are possible: * <code>:histogram</code> - calculated from <a href="#LOS-histogram">histogram</a> * <code>:kde</code> - calculated from KDE * <code>:pearson</code> - mode = mean-3(median-mean) * <code>:default</code> - discrete mode</p>
<p>Histogram accepts optional <code>:bins</code> (see <a href="#LOS-histogram">histogram</a>). KDE method accepts <code>:kde</code> for kernel name (default <code>:gaussian</code>) and <code>:bandwidth</code> (auto). Pearson can accept <code>:estimation-strategy</code> for median.</p>
<p>See also <a href="#LOS-modes">modes</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L586">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-modes"></span>
</section>
<section id="modes" class="level4">
<h4 class="anchored" data-anchor-id="modes">modes</h4>
<ul>
<li><code>(modes vs method)</code></li>
<li><code>(modes vs method opts)</code></li>
<li><code>(modes vs)</code></li>
</ul>
<p>Find the values that appears most often in a dataset <code>vs</code>.</p>
<p>Returns sequence with all most appearing values in increasing order.</p>
<p>See also <a href="#LOS-mode">mode</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L555">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-modified-power-transformation"></span>
</section>
<section id="modified-power-transformation" class="level4">
<h4 class="anchored" data-anchor-id="modified-power-transformation">modified-power-transformation</h4>
<ul>
<li><code>(modified-power-transformation xs)</code></li>
<li><code>(modified-power-transformation xs lambda)</code></li>
<li><code>(modified-power-transformation xs lambda alpha)</code></li>
</ul>
<p>Modified power transformation (Box-Cox transformation) of data.</p>
<p>There is no scaling by geometric mean.</p>
<p>Arguments: * <code>lambda</code> - power parameter (default: 0.0) * <code>alpha</code> - shift parameter (optional)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3124">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-moment"></span>
</section>
<section id="moment" class="level4">
<h4 class="anchored" data-anchor-id="moment">moment</h4>
<ul>
<li><code>(moment vs)</code></li>
<li><code>(moment vs order)</code></li>
<li><code>(moment vs order {:keys [absolute? center mean? normalize?], :or {mean? true}})</code></li>
</ul>
<p>Calculate moment (central or/and absolute) of given order (default: 2).</p>
<p>Additional parameters as a map:</p>
<ul>
<li><code>:absolute?</code> - calculate sum as absolute values (default: <code>false</code>)</li>
<li><code>:mean?</code> - returns mean (proper moment) or just sum of differences (default: <code>true</code>)</li>
<li><code>:center</code> - value of center (default: <code>nil</code> = mean)</li>
<li><code>:normalize?</code> - apply normalization by standard deviation to the order power</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L632">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-mse"></span>
</section>
<section id="mse" class="level4">
<h4 class="anchored" data-anchor-id="mse">mse</h4>
<ul>
<li><code>(mse [vs1 vs2-or-val])</code></li>
<li><code>(mse vs1 vs2-or-val)</code></li>
</ul>
<p>Mean squared error</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1081">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-multinomial-likelihood-ratio-test"></span>
</section>
<section id="multinomial-likelihood-ratio-test" class="level4">
<h4 class="anchored" data-anchor-id="multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</h4>
<ul>
<li><code>(multinomial-likelihood-ratio-test contingency-table-or-xs)</code></li>
<li><code>(multinomial-likelihood-ratio-test contingency-table-or-xs params)</code></li>
</ul>
<p>Multinomial likelihood ratio test, a power divergence test for <code>lambda</code> 0.0</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2894">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-neyman-modified-chisq-test"></span>
</section>
<section id="neyman-modified-chisq-test" class="level4">
<h4 class="anchored" data-anchor-id="neyman-modified-chisq-test">neyman-modified-chisq-test</h4>
<ul>
<li><code>(neyman-modified-chisq-test contingency-table-or-xs)</code></li>
<li><code>(neyman-modified-chisq-test contingency-table-or-xs params)</code></li>
</ul>
<p>Neyman modifield chi square test, a power divergence test for <code>lambda</code> -2.0</p>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2906">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-normality-test"></span>
</section>
<section id="normality-test" class="level4">
<h4 class="anchored" data-anchor-id="normality-test">normality-test</h4>
<ul>
<li><code>(normality-test xs)</code></li>
<li><code>(normality-test xs params)</code></li>
<li><code>(normality-test xs skew kurt {:keys [sides], :or {sides :one-sided-greater}})</code></li>
</ul>
<p>Normality test based on skewness and kurtosis</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2511">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-omega-sq"></span>
</section>
<section id="omega-sq" class="level4">
<h4 class="anchored" data-anchor-id="omega-sq">omega-sq</h4>
<ul>
<li><code>(omega-sq [group1 group2])</code></li>
<li><code>(omega-sq group1 group2)</code></li>
<li><code>(omega-sq group1 group2 degrees-of-freedom)</code></li>
</ul>
<p>Adjusted R2</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1693">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-one-way-anova-test"></span>
</section>
<section id="one-way-anova-test" class="level4">
<h4 class="anchored" data-anchor-id="one-way-anova-test">one-way-anova-test</h4>
<ul>
<li><code>(one-way-anova-test xss)</code></li>
<li><code>(one-way-anova-test xss {:keys [sides], :or {sides :one-sided-greater}})</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2956">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-outer-fence-extent"></span>
</section>
<section id="outer-fence-extent" class="level4">
<h4 class="anchored" data-anchor-id="outer-fence-extent">outer-fence-extent</h4>
<ul>
<li><code>(outer-fence-extent vs)</code></li>
<li><code>(outer-fence-extent vs estimation-strategy)</code></li>
</ul>
<p>Returns LOF, UOF and median</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L493">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-outliers"></span>
</section>
<section id="outliers" class="level4">
<h4 class="anchored" data-anchor-id="outliers">outliers</h4>
<ul>
<li><code>(outliers vs)</code></li>
<li><code>(outliers vs estimation-strategy)</code></li>
<li><code>(outliers vs q1 q3)</code></li>
</ul>
<p>Find outliers defined as values outside inner fences.</p>
<p>Let Q1 is 25-percentile and Q3 is 75-percentile. IQR is <code>(- Q3 Q1)</code>.</p>
<ul>
<li>LIF (Lower Inner Fence) equals <code>(- Q1 (* 1.5 IQR))</code>.</li>
<li>UIF (Upper Inner Fence) equals <code>(+ Q3 (* 1.5 IQR))</code>.</li>
</ul>
<p>Returns a sequence of outliers.</p>
<p>Optional <code>estimation-strategy</code> argument can be set to change quantile calculations estimation type. See <a href="#LOS-estimation-strategies">estimation-strategies</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L501">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-p-overlap"></span>
</section>
<section id="p-overlap" class="level4">
<h4 class="anchored" data-anchor-id="p-overlap">p-overlap</h4>
<ul>
<li><code>(p-overlap [group1 group2])</code></li>
<li><code>(p-overlap group1 group2)</code></li>
<li><code>(p-overlap group1 group2 {:keys [kde bandwidth min-iterations steps], :or {kde :gaussian, min-iterations 3, steps 500}})</code></li>
</ul>
<p>Overlapping index, kernel density approximation</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1622">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-p-value"></span>
</section>
<section id="p-value" class="level4">
<h4 class="anchored" data-anchor-id="p-value">p-value</h4>
<ul>
<li><code>(p-value stat)</code></li>
<li><code>(p-value distribution stat)</code></li>
<li><code>(p-value distribution stat sides)</code></li>
</ul>
<p>Calculate p-value for given distribution (default: N(0,1)), <code>stat</code> and sides (one of <code>:two-sided</code>, <code>:one-sided-greater</code> or <code>:one-sided-less</code>/<code>:one-sided</code>).</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2450">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pacf"></span>
</section>
<section id="pacf" class="level4">
<h4 class="anchored" data-anchor-id="pacf">pacf</h4>
<ul>
<li><code>(pacf data)</code></li>
<li><code>(pacf data lags)</code></li>
</ul>
<p>Caluclate pacf (partial autocorrelation function) for given number of lags.</p>
<p>If lags is omitted function returns maximum possible number of lags.</p>
<p><code>pacf</code> returns also lag <code>0</code> (which is <code>0.0</code>).</p>
<p>See also <a href="#LOS-acf">acf</a>, <a href="#LOS-acf-ci">acf-ci</a>, <a href="#LOS-pacf-ci">pacf-ci</a></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2199">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pacf-ci"></span>
</section>
<section id="pacf-ci" class="level4">
<h4 class="anchored" data-anchor-id="pacf-ci">pacf-ci</h4>
<ul>
<li><code>(pacf-ci data)</code></li>
<li><code>(pacf-ci data lags)</code></li>
<li><code>(pacf-ci data lags alpha)</code></li>
</ul>
<p><a href="#LOS-pacf">pacf</a> with added confidence interval data.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2228">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pearson-correlation"></span>
</section>
<section id="pearson-correlation" class="level4">
<h4 class="anchored" data-anchor-id="pearson-correlation">pearson-correlation</h4>
<ul>
<li><code>(pearson-correlation [vs1 vs2])</code></li>
<li><code>(pearson-correlation vs1 vs2)</code></li>
</ul>
<p>Pearson’s correlation of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L971">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pearson-r"></span>
</section>
<section id="pearson-r" class="level4">
<h4 class="anchored" data-anchor-id="pearson-r">pearson-r</h4>
<ul>
<li><code>(pearson-r [group1 group2])</code></li>
<li><code>(pearson-r group1 group2)</code></li>
</ul>
<p>Pearson <code>r</code> correlation coefficient</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1668">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-percentile"></span>
</section>
<section id="percentile" class="level4">
<h4 class="anchored" data-anchor-id="percentile">percentile</h4>
<ul>
<li><code>(percentile vs p)</code></li>
<li><code>(percentile vs p estimation-strategy)</code></li>
</ul>
<p>Calculate percentile of a <code>vs</code>.</p>
<p>Percentile <code>p</code> is from range 0-100.</p>
<p>See <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.4/org/apache/commons/math3/stat/descriptive/rank/Percentile.html">docs</a>.</p>
<p>Optionally you can provide <code>estimation-strategy</code> to change interpolation methods for selecting values. Default is <code>:legacy</code>. See more <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html">here</a></p>
<p>See also <a href="#LOS-quantile">quantile</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L90">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-percentile-bc-extent"></span>
</section>
<section id="percentile-bc-extent" class="level4">
<h4 class="anchored" data-anchor-id="percentile-bc-extent">percentile-bc-extent</h4>
<ul>
<li><code>(percentile-bc-extent vs)</code></li>
<li><code>(percentile-bc-extent vs p)</code></li>
<li><code>(percentile-bc-extent vs p1 p2)</code></li>
<li><code>(percentile-bc-extent vs p1 p2 estimation-strategy)</code></li>
</ul>
<p>Return bias corrected percentile range and mean for bootstrap samples. See https://projecteuclid.org/euclid.ss/1032280214</p>
<p><code>p</code> - calculates extent of bias corrected <code>p</code> and <code>100-p</code> (default: <code>p=2.5</code>)</p>
<p>Set <code>estimation-strategy</code> to <code>:r7</code> to get the same result as in R <code>coxed::bca</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2301">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-percentile-bca-extent"></span>
</section>
<section id="percentile-bca-extent" class="level4">
<h4 class="anchored" data-anchor-id="percentile-bca-extent">percentile-bca-extent</h4>
<ul>
<li><code>(percentile-bca-extent vs)</code></li>
<li><code>(percentile-bca-extent vs p)</code></li>
<li><code>(percentile-bca-extent vs p1 p2)</code></li>
<li><code>(percentile-bca-extent vs p1 p2 estimation-strategy)</code></li>
<li><code>(percentile-bca-extent vs p1 p2 accel estimation-strategy)</code></li>
</ul>
<p>Return bias corrected percentile range and mean for bootstrap samples. Also accounts for variance variations throught the accelaration parameter. See https://projecteuclid.org/euclid.ss/1032280214</p>
<p><code>p</code> - calculates extent of bias corrected <code>p</code> and <code>100-p</code> (default: <code>p=2.5</code>)</p>
<p>Set <code>estimation-strategy</code> to <code>:r7</code> to get the same result as in R <code>coxed::bca</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2282">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-percentile-extent"></span>
</section>
<section id="percentile-extent" class="level4">
<h4 class="anchored" data-anchor-id="percentile-extent">percentile-extent</h4>
<ul>
<li><code>(percentile-extent vs)</code></li>
<li><code>(percentile-extent vs p)</code></li>
<li><code>(percentile-extent vs p1 p2)</code></li>
<li><code>(percentile-extent vs p1 p2 estimation-strategy)</code></li>
</ul>
<p>Return percentile range and median.</p>
<p><code>p</code> - calculates extent of <code>p</code> and <code>100-p</code> (default: <code>p=25</code>)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L379">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-percentiles"></span>
</section>
<section id="percentiles" class="level4">
<h4 class="anchored" data-anchor-id="percentiles">percentiles</h4>
<ul>
<li><code>(percentiles vs)</code></li>
<li><code>(percentiles vs ps)</code></li>
<li><code>(percentiles vs ps estimation-strategy)</code></li>
</ul>
<p>Calculate percentiles of a <code>vs</code>.</p>
<p>Percentiles are sequence of values from range 0-100.</p>
<p>See <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.4/org/apache/commons/math3/stat/descriptive/rank/Percentile.html">docs</a>.</p>
<p>Optionally you can provide <code>estimation-strategy</code> to change interpolation methods for selecting values. Default is <code>:legacy</code>. See more <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html">here</a></p>
<p>See also <a href="#LOS-quantile">quantile</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L106">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pi"></span>
</section>
<section id="pi" class="level4">
<h4 class="anchored" data-anchor-id="pi">pi</h4>
<ul>
<li><code>(pi vs)</code></li>
<li><code>(pi vs size)</code></li>
<li><code>(pi vs size estimation-strategy)</code></li>
</ul>
<p>Returns PI as a map, quantile intervals based on interval size.</p>
<p>Quantiles are <code>(1-size)/2</code> and <code>1-(1-size)/2</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L405">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pi-extent"></span>
</section>
<section id="pi-extent" class="level4">
<h4 class="anchored" data-anchor-id="pi-extent">pi-extent</h4>
<ul>
<li><code>(pi-extent vs)</code></li>
<li><code>(pi-extent vs size)</code></li>
<li><code>(pi-extent vs size estimation-strategy)</code></li>
</ul>
<p>Returns PI extent, quantile intervals based on interval size + median.</p>
<p>Quantiles are <code>(1-size)/2</code> and <code>1-(1-size)/2</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L419">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pooled-stddev"></span>
</section>
<section id="pooled-stddev" class="level4">
<h4 class="anchored" data-anchor-id="pooled-stddev">pooled-stddev</h4>
<ul>
<li><code>(pooled-stddev groups)</code></li>
<li><code>(pooled-stddev groups method)</code></li>
</ul>
<p>Calculate pooled standard deviation for samples and method</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1500">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-pooled-variance"></span>
</section>
<section id="pooled-variance" class="level4">
<h4 class="anchored" data-anchor-id="pooled-variance">pooled-variance</h4>
<ul>
<li><code>(pooled-variance groups)</code></li>
<li><code>(pooled-variance groups method)</code></li>
</ul>
<p>Calculate pooled variance for samples and method.</p>
<p>Methods: * <code>:unbiased</code> - sqrt of weighted average of variances (default) * <code>:biased</code> - biased version of <code>:unbiased</code> * <code>:avg</code> - sqrt of average of variances</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1482">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-population-stddev"></span>
</section>
<section id="population-stddev" class="level4">
<h4 class="anchored" data-anchor-id="population-stddev">population-stddev</h4>
<ul>
<li><code>(population-stddev vs)</code></li>
<li><code>(population-stddev vs mu)</code></li>
</ul>
<p>Calculate population standard deviation of <code>vs</code>.</p>
<p>See <a href="#LOS-stddev">stddev</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L304">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-population-variance"></span>
</section>
<section id="population-variance" class="level4">
<h4 class="anchored" data-anchor-id="population-variance">population-variance</h4>
<ul>
<li><code>(population-variance vs)</code></li>
<li><code>(population-variance vs mu)</code></li>
</ul>
<p>Calculate population variance of <code>vs</code>.</p>
<p>See <a href="#LOS-variance">variance</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L268">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-population-wstddev"></span>
</section>
<section id="population-wstddev" class="level4">
<h4 class="anchored" data-anchor-id="population-wstddev">population-wstddev</h4>
<ul>
<li><code>(population-wstddev vs weights)</code></li>
</ul>
<p>Calculate population weighted standard deviation of <code>vs</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L313">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-population-wvariance"></span>
</section>
<section id="population-wvariance" class="level4">
<h4 class="anchored" data-anchor-id="population-wvariance">population-wvariance</h4>
<ul>
<li><code>(population-wvariance vs freqs)</code></li>
</ul>
<p>Calculate population weighted variance of <code>vs</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L277">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-power-divergence-test"></span>
</section>
<section id="power-divergence-test" class="level4">
<h4 class="anchored" data-anchor-id="power-divergence-test">power-divergence-test</h4>
<ul>
<li><code>(power-divergence-test contingency-table-or-xs)</code></li>
<li><code>(power-divergence-test contingency-table-or-xs {:keys [lambda ci-sides sides p alpha bootstrap-samples ddof bins], :or {lambda m/TWO_THIRD, sides :one-sided-greater, ci-sides :two-sided, alpha 0.05, bootstrap-samples 1000, ddof 0}})</code></li>
</ul>
<p>Power divergence test.</p>
<p>First argument should be one of:</p>
<ul>
<li>contingency table</li>
<li>sequence of counts (for goodness of fit)</li>
<li>sequence of data (for goodness of fit against distribution)</li>
</ul>
<p>For goodness of fit there are two options:</p>
<ul>
<li>comparison of observed counts vs expected probabilities or weights (<code>:p</code>)</li>
<li>comparison of data against given distribution (<code>:p</code>), in this case histogram from data is created and compared to distribution PDF in bins ranges. Use <code>:bins</code> option to control histogram creation.</li>
</ul>
<p>Options are:</p>
<ul>
<li><code>:lambda</code> - test type:
<ul>
<li><code>1.0</code> - <a href="#LOS-chisq-test">chisq-test</a></li>
<li><code>0.0</code> - <a href="#LOS-multinomial-likelihood-ratio-test">multinomial-likelihood-ratio-test</a></li>
<li><code>-1.0</code> - <a href="#LOS-minimum-discrimination-information-test">minimum-discrimination-information-test</a></li>
<li><code>-2.0</code> - <a href="#LOS-neyman-modified-chisq-test">neyman-modified-chisq-test</a></li>
<li><code>-0.5</code> - <a href="#LOS-freeman-tukey-test">freeman-tukey-test</a></li>
<li><code>2/3</code> - <a href="#LOS-cressie-read-test">cressie-read-test</a> - default</li>
</ul></li>
<li><code>:p</code> - probabilites, weights or distribution object.</li>
<li><code>:alpha</code> - significance level (default: 0.05)</li>
<li><code>:ci-sides</code> - confidence interval sides (default: <code>:two-sided</code>)</li>
<li><code>:sides</code> - p-value sides (<code>:two-sided</code>, <code>:one-side-greater</code> - default, <code>:one-side-less</code>)</li>
<li><code>:bootstrap-samples</code> - number of samples to estimate confidence intervals (default: 1000)</li>
<li><code>:ddof</code> - delta degrees of freedom, adjustment for dof (default: 0.0)</li>
<li><code>:bins</code> - number of bins or estimator name for histogram</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2838">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-power-transformation"></span>
</section>
<section id="power-transformation" class="level4">
<h4 class="anchored" data-anchor-id="power-transformation">power-transformation</h4>
<ul>
<li><code>(power-transformation xs)</code></li>
<li><code>(power-transformation xs lambda)</code></li>
<li><code>(power-transformation xs lambda alpha)</code></li>
</ul>
<p>Power transformation of data.</p>
<p>All values should be positive.</p>
<p>Arguments: * <code>lambda</code> - power parameter (default: 0.0) * <code>alpha</code> - shift parameter (optional)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3106">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-powmean"></span>
</section>
<section id="powmean" class="level4">
<h4 class="anchored" data-anchor-id="powmean">powmean</h4>
<ul>
<li><code>(powmean vs power)</code></li>
<li><code>(powmean vs weights power)</code></li>
</ul>
<p>Generalized power mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L240">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-psnr"></span>
</section>
<section id="psnr" class="level4">
<h4 class="anchored" data-anchor-id="psnr">psnr</h4>
<ul>
<li><code>(psnr [vs1 vs2-or-val])</code></li>
<li><code>(psnr vs1 vs2-or-val)</code></li>
<li><code>(psnr vs1 vs2-or-val max-value)</code></li>
</ul>
<p>Peak signal to noise, <code>max-value</code> is maximum possible value (default: max from <code>vs1</code> and <code>vs2</code>)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1131">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-quantile"></span>
</section>
<section id="quantile" class="level4">
<h4 class="anchored" data-anchor-id="quantile">quantile</h4>
<ul>
<li><code>(quantile vs q)</code></li>
<li><code>(quantile vs q estimation-strategy)</code></li>
</ul>
<p>Calculate quantile of a <code>vs</code>.</p>
<p>Quantile <code>q</code> is from range 0.0-1.0.</p>
<p>See <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.4/org/apache/commons/math3/stat/descriptive/rank/Percentile.html">docs</a> for interpolation strategy.</p>
<p>Optionally you can provide <code>estimation-strategy</code> to change interpolation methods for selecting values. Default is <code>:legacy</code>. See more <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html">here</a></p>
<p>See also <a href="#LOS-percentile">percentile</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L123">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-quantile-extent"></span>
</section>
<section id="quantile-extent" class="level4">
<h4 class="anchored" data-anchor-id="quantile-extent">quantile-extent</h4>
<ul>
<li><code>(quantile-extent vs)</code></li>
<li><code>(quantile-extent vs q)</code></li>
<li><code>(quantile-extent vs q1 q2)</code></li>
<li><code>(quantile-extent vs q1 q2 estimation-strategy)</code></li>
</ul>
<p>Return quantile range and median.</p>
<p><code>q</code> - calculates extent of <code>q</code> and <code>1.0-q</code> (default: <code>q=0.25</code>)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L392">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-quantiles"></span>
</section>
<section id="quantiles" class="level4">
<h4 class="anchored" data-anchor-id="quantiles">quantiles</h4>
<ul>
<li><code>(quantiles vs)</code></li>
<li><code>(quantiles vs qs)</code></li>
<li><code>(quantiles vs qs estimation-strategy)</code></li>
</ul>
<p>Calculate quantiles of a <code>vs</code>.</p>
<p>Quantilizes is sequence with values from range 0.0-1.0.</p>
<p>See <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.4/org/apache/commons/math3/stat/descriptive/rank/Percentile.html">docs</a> for interpolation strategy.</p>
<p>Optionally you can provide <code>estimation-strategy</code> to change interpolation methods for selecting values. Default is <code>:legacy</code>. See more <a href="http://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/descriptive/rank/Percentile.EstimationType.html">here</a></p>
<p>See also <a href="#LOS-percentiles">percentiles</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L138">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-r2"></span>
</section>
<section id="r2" class="level4">
<h4 class="anchored" data-anchor-id="r2">r2</h4>
<ul>
<li><code>(r2 [vs1 vs2-or-val])</code></li>
<li><code>(r2 vs1 vs2-or-val)</code></li>
<li><code>(r2 vs1 vs2-or-val no-of-variables)</code></li>
</ul>
<p>R2</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1068">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-r2-determination"></span>
</section>
<section id="r2-determination" class="level4">
<h4 class="anchored" data-anchor-id="r2-determination">r2-determination</h4>
<ul>
<li><code>(r2-determination [group1 group2])</code></li>
<li><code>(r2-determination group1 group2)</code></li>
</ul>
<p>Coefficient of determination</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1674">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rank-epsilon-sq"></span>
</section>
<section id="rank-epsilon-sq" class="level4">
<h4 class="anchored" data-anchor-id="rank-epsilon-sq">rank-epsilon-sq</h4>
<ul>
<li><code>(rank-epsilon-sq xs)</code></li>
</ul>
<p>Effect size for Kruskal-Wallis test</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1763">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rank-eta-sq"></span>
</section>
<section id="rank-eta-sq" class="level4">
<h4 class="anchored" data-anchor-id="rank-eta-sq">rank-eta-sq</h4>
<ul>
<li><code>(rank-eta-sq xs)</code></li>
</ul>
<p>Effect size for Kruskal-Wallis test</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1756">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-remove-outliers"></span>
</section>
<section id="remove-outliers" class="level4">
<h4 class="anchored" data-anchor-id="remove-outliers">remove-outliers</h4>
<ul>
<li><code>(remove-outliers vs)</code></li>
<li><code>(remove-outliers vs estimation-strategy)</code></li>
<li><code>(remove-outliers vs q1 q3)</code></li>
</ul>
<p>Remove outliers defined as values outside inner fences.</p>
<p>Let Q1 is 25-percentile and Q3 is 75-percentile. IQR is <code>(- Q3 Q1)</code>.</p>
<ul>
<li>LIF (Lower Inner Fence) equals <code>(- Q1 (* 1.5 IQR))</code>.</li>
<li>UIF (Upper Inner Fence) equals <code>(+ Q3 (* 1.5 IQR))</code>.</li>
</ul>
<p>Returns a sequence without outliers.</p>
<p>Optional <code>estimation-strategy</code> argument can be set to change quantile calculations estimation type. See <a href="#LOS-estimation-strategies">estimation-strategies</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L527">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rescale"></span>
</section>
<section id="rescale" class="level4">
<h4 class="anchored" data-anchor-id="rescale">rescale</h4>
<ul>
<li><code>(rescale vs)</code></li>
<li><code>(rescale vs low high)</code></li>
</ul>
<p>Lineary rascale data to desired range, [0,1] by default</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L932">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rmse"></span>
</section>
<section id="rmse" class="level4">
<h4 class="anchored" data-anchor-id="rmse">rmse</h4>
<ul>
<li><code>(rmse [vs1 vs2-or-val])</code></li>
<li><code>(rmse vs1 vs2-or-val)</code></li>
</ul>
<p>Root mean squared error</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1088">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-robust-standardize"></span>
</section>
<section id="robust-standardize" class="level4">
<h4 class="anchored" data-anchor-id="robust-standardize">robust-standardize</h4>
<ul>
<li><code>(robust-standardize vs)</code></li>
<li><code>(robust-standardize vs q)</code></li>
</ul>
<p>Normalize samples to have median = 0 and MAD = 1.</p>
<p>If <code>q</code> argument is used, scaling is done by quantile difference (Q_q, Q_(1-q)). Set 0.25 for IQR.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L911">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rows->contingency-table"></span>
</section>
<section id="rows-contingency-table" class="level4">
<h4 class="anchored" data-anchor-id="rows-contingency-table">rows-&gt;contingency-table</h4>
<ul>
<li><code>(rows-&gt;contingency-table xss)</code></li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1778">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-rss"></span>
</section>
<section id="rss" class="level4">
<h4 class="anchored" data-anchor-id="rss">rss</h4>
<ul>
<li><code>(rss [vs1 vs2-or-val])</code></li>
<li><code>(rss vs1 vs2-or-val)</code></li>
</ul>
<p>Residual sum of squares</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1061">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-second-moment"></span>
</section>
<section id="second-moment-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="second-moment-deprecated">second-moment <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <a href="#LOS-moment">moment</a> function</em></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L663">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sem"></span>
</section>
<section id="sem" class="level4">
<h4 class="anchored" data-anchor-id="sem">sem</h4>
<ul>
<li><code>(sem vs)</code></li>
</ul>
<p>Standard error of mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L359">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sem-extent"></span>
</section>
<section id="sem-extent" class="level4">
<h4 class="anchored" data-anchor-id="sem-extent">sem-extent</h4>
<ul>
<li><code>(sem-extent vs)</code></li>
</ul>
<p>-/+ sem and mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L377">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-similarity"></span>
</section>
<section id="similarity" class="level4">
<h4 class="anchored" data-anchor-id="similarity">similarity</h4>
<ul>
<li><code>(similarity method P-observed Q-expected)</code></li>
<li><code>(similarity method P-observed Q-expected {:keys [bins probabilities? epsilon], :or {probabilities? true, epsilon 1.0E-6}})</code></li>
</ul>
<p>Various PDF similarities between two histograms (frequencies) or probabilities.</p>
<p>Q can be a distribution object. Then, histogram will be created out of P.</p>
<p>Arguments:</p>
<ul>
<li><code>method</code> - distance method</li>
<li><code>P-observed</code> - frequencies, probabilities or actual data (when Q is a distribution)</li>
<li><code>Q-expected</code> - frequencies, probabilities or distribution object (when P is a data)</li>
</ul>
<p>Options:</p>
<ul>
<li><code>:probabilities?</code> - should P/Q be converted to a probabilities, default: <code>true</code>.</li>
<li><code>:epsilon</code> - small number which replaces <code>0.0</code> when division or logarithm is used`</li>
<li><code>:bins</code> - number of bins or bins estimation method, see <a href="#LOS-histogram">histogram</a>.</li>
</ul>
<p>The list of methods: <code>:intersection</code>, <code>:czekanowski</code>, <code>:motyka</code>, <code>:kulczynski</code>, <code>:ruzicka</code>, <code>:inner-product</code>, <code>:harmonic-mean</code>, <code>:cosine</code>, <code>:jaccard</code>, <code>:dice</code>, <code>:fidelity</code>, <code>:squared-chord</code></p>
<p>See more: Comprehensive Survey on Distance/Similarity Measures between Probability Density Functions by Sung-Hyuk Cha</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1428">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-skewness"></span>
</section>
<section id="skewness" class="level4">
<h4 class="anchored" data-anchor-id="skewness">skewness</h4>
<ul>
<li><code>(skewness vs)</code></li>
<li><code>(skewness vs typ)</code></li>
</ul>
<p>Calculate skewness from sequence.</p>
<p>Possible types: <code>:G1</code> (default), <code>:g1</code> (<code>:pearson</code>), <code>:b1</code>, <code>:B1</code> (<code>:yule</code>), <code>:B3</code>, <code>:skew</code>, <code>:mode</code>, <code>:bowley</code>, <code>:hogg</code> or <code>:median</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L732">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-skewness-test"></span>
</section>
<section id="skewness-test" class="level4">
<h4 class="anchored" data-anchor-id="skewness-test">skewness-test</h4>
<ul>
<li><code>(skewness-test xs)</code></li>
<li><code>(skewness-test xs params)</code></li>
<li><code>(skewness-test xs skew {:keys [sides type], :or {sides :two-sided, type :g1}})</code></li>
</ul>
<p>Normality test for skewness.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2462">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-span"></span>
</section>
<section id="span" class="level4">
<h4 class="anchored" data-anchor-id="span">span</h4>
<ul>
<li><code>(span vs)</code></li>
</ul>
<p>Width of the sample, maximum value minus minimum value</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L619">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-spearman-correlation"></span>
</section>
<section id="spearman-correlation" class="level4">
<h4 class="anchored" data-anchor-id="spearman-correlation">spearman-correlation</h4>
<ul>
<li><code>(spearman-correlation [vs1 vs2])</code></li>
<li><code>(spearman-correlation vs1 vs2)</code></li>
</ul>
<p>Spearman’s correlation of two sequences.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L965">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-standardize"></span>
</section>
<section id="standardize" class="level4">
<h4 class="anchored" data-anchor-id="standardize">standardize</h4>
<ul>
<li><code>(standardize vs)</code></li>
</ul>
<p>Normalize samples to have mean = 0 and stddev = 1.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L906">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-stats-map"></span>
</section>
<section id="stats-map" class="level4">
<h4 class="anchored" data-anchor-id="stats-map">stats-map</h4>
<ul>
<li><code>(stats-map vs)</code></li>
<li><code>(stats-map vs estimation-strategy)</code></li>
</ul>
<p>Calculate several statistics of <code>vs</code> and return as map.</p>
<p>Optional <code>estimation-strategy</code> argument can be set to change quantile calculations estimation type. See <a href="#LOS-estimation-strategies">estimation-strategies</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L862">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-stddev"></span>
</section>
<section id="stddev" class="level4">
<h4 class="anchored" data-anchor-id="stddev">stddev</h4>
<ul>
<li><code>(stddev vs)</code></li>
<li><code>(stddev vs mu)</code></li>
</ul>
<p>Calculate standard deviation of <code>vs</code>.</p>
<p>See <a href="#LOS-population-stddev">population-stddev</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L318">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-stddev-extent"></span>
</section>
<section id="stddev-extent" class="level4">
<h4 class="anchored" data-anchor-id="stddev-extent">stddev-extent</h4>
<ul>
<li><code>(stddev-extent vs)</code></li>
</ul>
<p>-/+ stddev and mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L375">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-sum"></span>
</section>
<section id="sum" class="level4">
<h4 class="anchored" data-anchor-id="sum">sum</h4>
<ul>
<li><code>(sum vs)</code></li>
</ul>
<p>Sum of all <code>vs</code> values.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L83">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-t-test-one-sample"></span>
</section>
<section id="t-test-one-sample" class="level4">
<h4 class="anchored" data-anchor-id="t-test-one-sample">t-test-one-sample</h4>
<ul>
<li><code>(t-test-one-sample xs)</code></li>
<li><code>(t-test-one-sample xs m)</code></li>
</ul>
<p>One sample Student’s t-test</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code>, <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
<li><code>mu</code> - mean (default: <code>0.0</code>)</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2609">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-t-test-two-samples"></span>
</section>
<section id="t-test-two-samples" class="level4">
<h4 class="anchored" data-anchor-id="t-test-two-samples">t-test-two-samples</h4>
<ul>
<li><code>(t-test-two-samples xs ys)</code></li>
<li><code>(t-test-two-samples xs ys {:keys [paired? equal-variances?], :or {paired? false, equal-variances? false}, :as params})</code></li>
</ul>
<p>Two samples Student’s t-test</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code> (default), <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
<li><code>mu</code> - mean (default: <code>0.0</code>)</li>
<li><code>paired?</code> - unpaired or paired test, boolean (default: <code>false</code>)</li>
<li><code>equal-variances?</code> - unequal or equal variances, boolean (default: <code>false</code>)</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2686">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-trim"></span>
</section>
<section id="trim" class="level4">
<h4 class="anchored" data-anchor-id="trim">trim</h4>
<ul>
<li><code>(trim vs)</code></li>
<li><code>(trim vs quantile)</code></li>
<li><code>(trim vs quantile estimation-strategy)</code></li>
<li><code>(trim vs low high nan)</code></li>
</ul>
<p>Return trimmed data. Trim is done by using quantiles, by default is set to 0.2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L680">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-trim-lower"></span>
</section>
<section id="trim-lower" class="level4">
<h4 class="anchored" data-anchor-id="trim-lower">trim-lower</h4>
<ul>
<li><code>(trim-lower vs)</code></li>
<li><code>(trim-lower vs quantile)</code></li>
<li><code>(trim-lower vs quantile estimation-strategy)</code></li>
</ul>
<p>Trim data below given quanitle, default: 0.2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L696">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-trim-upper"></span>
</section>
<section id="trim-upper" class="level4">
<h4 class="anchored" data-anchor-id="trim-upper">trim-upper</h4>
<ul>
<li><code>(trim-upper vs)</code></li>
<li><code>(trim-upper vs quantile)</code></li>
<li><code>(trim-upper vs quantile estimation-strategy)</code></li>
</ul>
<p>Trim data above given quanitle, default: 0.2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L704">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-tschuprows-t"></span>
</section>
<section id="tschuprows-t" class="level4">
<h4 class="anchored" data-anchor-id="tschuprows-t">tschuprows-t</h4>
<ul>
<li><code>(tschuprows-t group1 group2)</code></li>
<li><code>(tschuprows-t contingency-table)</code></li>
</ul>
<p>Tschuprows T effect size for discrete data</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1855">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ttest-one-sample"></span>
</section>
<section id="ttest-one-sample-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="ttest-one-sample-deprecated">ttest-one-sample <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <a href="#LOS-t-test-one-sample">t-test-one-sample</a></em></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2624">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-ttest-two-samples"></span>
</section>
<section id="ttest-two-samples-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="ttest-two-samples-deprecated">ttest-two-samples <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <a href="#LOS-t-test-two-samples">t-test-two-samples</a></em></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2713">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-variance"></span>
</section>
<section id="variance" class="level4">
<h4 class="anchored" data-anchor-id="variance">variance</h4>
<ul>
<li><code>(variance vs)</code></li>
<li><code>(variance vs mu)</code></li>
</ul>
<p>Calculate variance of <code>vs</code>.</p>
<p>See <a href="#LOS-population-variance">population-variance</a>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L286">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-variation"></span>
</section>
<section id="variation" class="level4">
<h4 class="anchored" data-anchor-id="variation">variation</h4>
<ul>
<li><code>(variation vs)</code></li>
</ul>
<p>Coefficient of variation CV = stddev / mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L332">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-weighted-kappa"></span>
</section>
<section id="weighted-kappa" class="level4">
<h4 class="anchored" data-anchor-id="weighted-kappa">weighted-kappa</h4>
<ul>
<li><code>(weighted-kappa contingency-table)</code></li>
<li><code>(weighted-kappa contingency-table weights)</code></li>
</ul>
<p>Cohen’s weighted kappa for indexed contingency table</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1882">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-winsor"></span>
</section>
<section id="winsor" class="level4">
<h4 class="anchored" data-anchor-id="winsor">winsor</h4>
<ul>
<li><code>(winsor vs)</code></li>
<li><code>(winsor vs quantile)</code></li>
<li><code>(winsor vs quantile estimation-strategy)</code></li>
<li><code>(winsor vs low high nan)</code></li>
</ul>
<p>Return winsorized data. Trim is done by using quantiles, by default is set to 0.2.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L665">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wmean"></span>
</section>
<section id="wmean-deprecated" class="level4">
<h4 class="anchored" data-anchor-id="wmean-deprecated">wmean <sup><sub>DEPRECATED</sub></sup></h4>
<p><em>Deprecated: Use <code>mean</code></em></p>
<ul>
<li><code>(wmean vs)</code></li>
<li><code>(wmean vs weights)</code></li>
</ul>
<p>Weighted mean</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L261">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wmedian"></span>
</section>
<section id="wmedian" class="level4">
<h4 class="anchored" data-anchor-id="wmedian">wmedian</h4>
<ul>
<li><code>(wmedian vs ws)</code></li>
<li><code>(wmedian vs ws method)</code></li>
</ul>
<p>Weighted median.</p>
<p>Calculation is done using interpolation. There are three methods: * <code>:linear</code> - linear interpolation, default * <code>:step</code> - step interpolation * <code>:average</code> - average of ties</p>
<p>Based on <code>spatstat.geom::weighted.quantile</code> from R.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L201">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wmw-odds"></span>
</section>
<section id="wmw-odds" class="level4">
<h4 class="anchored" data-anchor-id="wmw-odds">wmw-odds</h4>
<ul>
<li><code>(wmw-odds [group1 group2])</code></li>
<li><code>(wmw-odds group1 group2)</code></li>
</ul>
<p>Wilcoxon-Mann-Whitney odds</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L1607">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wquantile"></span>
</section>
<section id="wquantile" class="level4">
<h4 class="anchored" data-anchor-id="wquantile">wquantile</h4>
<ul>
<li><code>(wquantile vs ws q)</code></li>
<li><code>(wquantile vs ws q method)</code></li>
</ul>
<p>Weighted quantile.</p>
<p>Calculation is done using interpolation. There are three methods: * <code>:linear</code> - linear interpolation, default * <code>:step</code> - step interpolation * <code>:average</code> - average of ties</p>
<p>Based on <code>spatstat.geom::weighted.quantile</code> from R.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L172">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wquantiles"></span>
</section>
<section id="wquantiles" class="level4">
<h4 class="anchored" data-anchor-id="wquantiles">wquantiles</h4>
<ul>
<li><code>(wquantiles vs ws)</code></li>
<li><code>(wquantiles vs ws qs)</code></li>
<li><code>(wquantiles vs ws qs method)</code></li>
</ul>
<p>Weighted quantiles.</p>
<p>Calculation is done using interpolation. There are three methods: * <code>:linear</code> - linear interpolation, default * <code>:step</code> - step interpolation * <code>:average</code> - average of ties</p>
<p>Based on <code>spatstat.geom::weighted.quantile</code> from R.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L186">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wstddev"></span>
</section>
<section id="wstddev" class="level4">
<h4 class="anchored" data-anchor-id="wstddev">wstddev</h4>
<ul>
<li><code>(wstddev vs freqs)</code></li>
</ul>
<p>Calculate weighted (unbiased) standard deviation of <code>vs</code></p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L327">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-wvariance"></span>
</section>
<section id="wvariance" class="level4">
<h4 class="anchored" data-anchor-id="wvariance">wvariance</h4>
<ul>
<li><code>(wvariance vs freqs)</code></li>
</ul>
<p>Calculate weighted (unbiased) variance of <code>vs</code>.</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L295">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-yeo-johnson-transformation"></span>
</section>
<section id="yeo-johnson-transformation" class="level4">
<h4 class="anchored" data-anchor-id="yeo-johnson-transformation">yeo-johnson-transformation</h4>
<ul>
<li><code>(yeo-johnson-transformation xs)</code></li>
<li><code>(yeo-johnson-transformation xs lambda)</code></li>
<li><code>(yeo-johnson-transformation xs lambda alpha)</code></li>
</ul>
<p>Yeo-Johnson transformation</p>
<p>Arguments: * <code>lambda</code> - power parameter (default: 0.0) * <code>alpha</code> - shift parameter (optional)</p>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L3143">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-z-test-one-sample"></span>
</section>
<section id="z-test-one-sample" class="level4">
<h4 class="anchored" data-anchor-id="z-test-one-sample">z-test-one-sample</h4>
<ul>
<li><code>(z-test-one-sample xs)</code></li>
<li><code>(z-test-one-sample xs m)</code></li>
</ul>
<p>One sample z-test</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code>, <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
<li><code>mu</code> - mean (default: <code>0.0</code>)</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2626">source</a></small><hr style="margin: 0"></div>
<span id="#LOS-z-test-two-samples"></span>
</section>
<section id="z-test-two-samples" class="level4">
<h4 class="anchored" data-anchor-id="z-test-two-samples">z-test-two-samples</h4>
<ul>
<li><code>(z-test-two-samples xs ys)</code></li>
<li><code>(z-test-two-samples xs ys {:keys [paired? equal-variances?], :or {paired? false, equal-variances? false}, :as params})</code></li>
</ul>
<p>Two samples z-test</p>
<ul>
<li><code>alpha</code> - significance level (default: <code>0.05</code>)</li>
<li><code>sides</code> - one of: <code>:two-sided</code> (default), <code>:one-sided-less</code> (short: <code>:one-sided</code>) or <code>:one-sided-greater</code></li>
<li><code>mu</code> - mean (default: <code>0.0</code>)</li>
<li><code>paired?</code> - unpaired or paired test, boolean (default: <code>false</code>)</li>
<li><code>equal-variances?</code> - unequal or equal variances, boolean (default: <code>false</code>)</li>
</ul>
<div style="text-align: right"><small><a href="https://github.com/generateme/fastmath/tree/3.x/src/fastmath/stats.clj#L2715">source</a></small><hr style="margin: 0"></div>
<div style="background-color:grey;height:2px;width:100%;"></div>
<div><pre><small><small>source: <a href="https://github.com/generateme/fastmath//blob/master/clay/stats.clj">clay/stats.clj</a></small></small></pre></div>


</section>
</section>
</section>

</main> <!-- /main -->
<script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
  const toggleBodyColorMode = (bsSheetEl) => {
    const mode = bsSheetEl.getAttribute("data-mode");
    const bodyEl = window.document.querySelector("body");
    if (mode === "dark") {
      bodyEl.classList.add("quarto-dark");
      bodyEl.classList.remove("quarto-light");
    } else {
      bodyEl.classList.add("quarto-light");
      bodyEl.classList.remove("quarto-dark");
    }
  }
  const toggleBodyColorPrimary = () => {
    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
    if (bsSheetEl) {
      toggleBodyColorMode(bsSheetEl);
    }
  }
  toggleBodyColorPrimary();  
  const icon = "";
  const anchorJS = new window.AnchorJS();
  anchorJS.options = {
    placement: 'right',
    icon: icon
  };
  anchorJS.add('.anchored');
  const isCodeAnnotation = (el) => {
    for (const clz of el.classList) {
      if (clz.startsWith('code-annotation-')) {                     
        return true;
      }
    }
    return false;
  }
  const clipboard = new window.ClipboardJS('.code-copy-button', {
    text: function(trigger) {
      const codeEl = trigger.previousElementSibling.cloneNode(true);
      for (const childEl of codeEl.children) {
        if (isCodeAnnotation(childEl)) {
          childEl.remove();
        }
      }
      return codeEl.innerText;
    }
  });
  clipboard.on('success', function(e) {
    // button target
    const button = e.trigger;
    // don't keep focus
    button.blur();
    // flash "checked"
    button.classList.add('code-copy-button-checked');
    var currentTitle = button.getAttribute("title");
    button.setAttribute("title", "Copied!");
    let tooltip;
    if (window.bootstrap) {
      button.setAttribute("data-bs-toggle", "tooltip");
      button.setAttribute("data-bs-placement", "left");
      button.setAttribute("data-bs-title", "Copied!");
      tooltip = new bootstrap.Tooltip(button, 
        { trigger: "manual", 
          customClass: "code-copy-button-tooltip",
          offset: [0, -8]});
      tooltip.show();    
    }
    setTimeout(function() {
      if (tooltip) {
        tooltip.hide();
        button.removeAttribute("data-bs-title");
        button.removeAttribute("data-bs-toggle");
        button.removeAttribute("data-bs-placement");
      }
      button.setAttribute("title", currentTitle);
      button.classList.remove('code-copy-button-checked');
    }, 1000);
    // clear code selection
    e.clearSelection();
  });
  function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
    const config = {
      allowHTML: true,
      maxWidth: 500,
      delay: 100,
      arrow: false,
      appendTo: function(el) {
          return el.parentElement;
      },
      interactive: true,
      interactiveBorder: 10,
      theme: 'quarto',
      placement: 'bottom-start',
    };
    if (contentFn) {
      config.content = contentFn;
    }
    if (onTriggerFn) {
      config.onTrigger = onTriggerFn;
    }
    if (onUntriggerFn) {
      config.onUntrigger = onUntriggerFn;
    }
    window.tippy(el, config); 
  }
  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
  for (var i=0; i<noterefs.length; i++) {
    const ref = noterefs[i];
    tippyHover(ref, function() {
      // use id or data attribute instead here
      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
      try { href = new URL(href).hash; } catch {}
      const id = href.replace(/^#\/?/, "");
      const note = window.document.getElementById(id);
      return note.innerHTML;
    });
  }
  const xrefs = window.document.querySelectorAll('a.quarto-xref');
  const processXRef = (id, note) => {
    // Strip column container classes
    const stripColumnClz = (el) => {
      el.classList.remove("page-full", "page-columns");
      if (el.children) {
        for (const child of el.children) {
          stripColumnClz(child);
        }
      }
    }
    stripColumnClz(note)
    if (id === null || id.startsWith('sec-')) {
      // Special case sections, only their first couple elements
      const container = document.createElement("div");
      if (note.children && note.children.length > 2) {
        container.appendChild(note.children[0].cloneNode(true));
        for (let i = 1; i < note.children.length; i++) {
          const child = note.children[i];
          if (child.tagName === "P" && child.innerText === "") {
            continue;
          } else {
            container.appendChild(child.cloneNode(true));
            break;
          }
        }
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(container);
        }
        return container.innerHTML
      } else {
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(note);
        }
        return note.innerHTML;
      }
    } else {
      // Remove any anchor links if they are present
      const anchorLink = note.querySelector('a.anchorjs-link');
      if (anchorLink) {
        anchorLink.remove();
      }
      if (window.Quarto?.typesetMath) {
        window.Quarto.typesetMath(note);
      }
      // TODO in 1.5, we should make sure this works without a callout special case
      if (note.classList.contains("callout")) {
        return note.outerHTML;
      } else {
        return note.innerHTML;
      }
    }
  }
  for (var i=0; i<xrefs.length; i++) {
    const xref = xrefs[i];
    tippyHover(xref, undefined, function(instance) {
      instance.disable();
      let url = xref.getAttribute('href');
      let hash = undefined; 
      if (url.startsWith('#')) {
        hash = url;
      } else {
        try { hash = new URL(url).hash; } catch {}
      }
      if (hash) {
        const id = hash.replace(/^#\/?/, "");
        const note = window.document.getElementById(id);
        if (note !== null) {
          try {
            const html = processXRef(id, note.cloneNode(true));
            instance.setContent(html);
          } finally {
            instance.enable();
            instance.show();
          }
        } else {
          // See if we can fetch this
          fetch(url.split('#')[0])
          .then(res => res.text())
          .then(html => {
            const parser = new DOMParser();
            const htmlDoc = parser.parseFromString(html, "text/html");
            const note = htmlDoc.getElementById(id);
            if (note !== null) {
              const html = processXRef(id, note);
              instance.setContent(html);
            } 
          }).finally(() => {
            instance.enable();
            instance.show();
          });
        }
      } else {
        // See if we can fetch a full url (with no hash to target)
        // This is a special case and we should probably do some content thinning / targeting
        fetch(url)
        .then(res => res.text())
        .then(html => {
          const parser = new DOMParser();
          const htmlDoc = parser.parseFromString(html, "text/html");
          const note = htmlDoc.querySelector('main.content');
          if (note !== null) {
            // This should only happen for chapter cross references
            // (since there is no id in the URL)
            // remove the first header
            if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
              note.children[0].remove();
            }
            const html = processXRef(null, note);
            instance.setContent(html);
          } 
        }).finally(() => {
          instance.enable();
          instance.show();
        });
      }
    }, function(instance) {
    });
  }
      let selectedAnnoteEl;
      const selectorForAnnotation = ( cell, annotation) => {
        let cellAttr = 'data-code-cell="' + cell + '"';
        let lineAttr = 'data-code-annotation="' +  annotation + '"';
        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
        return selector;
      }
      const selectCodeLines = (annoteEl) => {
        const doc = window.document;
        const targetCell = annoteEl.getAttribute("data-target-cell");
        const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
        const lines = annoteSpan.getAttribute("data-code-lines").split(",");
        const lineIds = lines.map((line) => {
          return targetCell + "-" + line;
        })
        let top = null;
        let height = null;
        let parent = null;
        if (lineIds.length > 0) {
            //compute the position of the single el (top and bottom and make a div)
            const el = window.document.getElementById(lineIds[0]);
            top = el.offsetTop;
            height = el.offsetHeight;
            parent = el.parentElement.parentElement;
          if (lineIds.length > 1) {
            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
            const bottom = lastEl.offsetTop + lastEl.offsetHeight;
            height = bottom - top;
          }
          if (top !== null && height !== null && parent !== null) {
            // cook up a div (if necessary) and position it 
            let div = window.document.getElementById("code-annotation-line-highlight");
            if (div === null) {
              div = window.document.createElement("div");
              div.setAttribute("id", "code-annotation-line-highlight");
              div.style.position = 'absolute';
              parent.appendChild(div);
            }
            div.style.top = top - 2 + "px";
            div.style.height = height + 4 + "px";
            div.style.left = 0;
            let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
            if (gutterDiv === null) {
              gutterDiv = window.document.createElement("div");
              gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
              gutterDiv.style.position = 'absolute';
              const codeCell = window.document.getElementById(targetCell);
              const gutter = codeCell.querySelector('.code-annotation-gutter');
              gutter.appendChild(gutterDiv);
            }
            gutterDiv.style.top = top - 2 + "px";
            gutterDiv.style.height = height + 4 + "px";
          }
          selectedAnnoteEl = annoteEl;
        }
      };
      const unselectCodeLines = () => {
        const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
        elementsIds.forEach((elId) => {
          const div = window.document.getElementById(elId);
          if (div) {
            div.remove();
          }
        });
        selectedAnnoteEl = undefined;
      };
        // Handle positioning of the toggle
    window.addEventListener(
      "resize",
      throttle(() => {
        elRect = undefined;
        if (selectedAnnoteEl) {
          selectCodeLines(selectedAnnoteEl);
        }
      }, 10)
    );
    function throttle(fn, ms) {
    let throttle = false;
    let timer;
      return (...args) => {
        if(!throttle) { // first call gets through
            fn.apply(this, args);
            throttle = true;
        } else { // all the others get throttled
            if(timer) clearTimeout(timer); // cancel #2
            timer = setTimeout(() => {
              fn.apply(this, args);
              timer = throttle = false;
            }, ms);
        }
      };
    }
      // Attach click handler to the DT
      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
      for (const annoteDlNode of annoteDls) {
        annoteDlNode.addEventListener('click', (event) => {
          const clickedEl = event.target;
          if (clickedEl !== selectedAnnoteEl) {
            unselectCodeLines();
            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
            if (activeEl) {
              activeEl.classList.remove('code-annotation-active');
            }
            selectCodeLines(clickedEl);
            clickedEl.classList.add('code-annotation-active');
          } else {
            // Unselect the line
            unselectCodeLines();
            clickedEl.classList.remove('code-annotation-active');
          }
        });
      }
  const findCites = (el) => {
    const parentEl = el.parentElement;
    if (parentEl) {
      const cites = parentEl.dataset.cites;
      if (cites) {
        return {
          el,
          cites: cites.split(' ')
        };
      } else {
        return findCites(el.parentElement)
      }
    } else {
      return undefined;
    }
  };
  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
  for (var i=0; i<bibliorefs.length; i++) {
    const ref = bibliorefs[i];
    const citeInfo = findCites(ref);
    if (citeInfo) {
      tippyHover(citeInfo.el, function() {
        var popup = window.document.createElement('div');
        citeInfo.cites.forEach(function(cite) {
          var citeDiv = window.document.createElement('div');
          citeDiv.classList.add('hanging-indent');
          citeDiv.classList.add('csl-entry');
          var biblioDiv = window.document.getElementById('ref-' + cite);
          if (biblioDiv) {
            citeDiv.innerHTML = biblioDiv.innerHTML;
          }
          popup.appendChild(citeDiv);
        });
        return popup.innerHTML;
      });
    }
  }
});
</script>
<nav class="page-navigation">
  <div class="nav-page nav-page-previous">
      <a href="./random.html" class="pagination-link" aria-label="Random">
        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Random</span>
      </a>          
  </div>
  <div class="nav-page nav-page-next">
      <a href="./polynomials.html" class="pagination-link" aria-label="Polynomials">
        <span class="nav-page-text">Polynomials</span> <i class="bi bi-arrow-right-short"></i>
      </a>
  </div>
</nav>
</div> <!-- /content -->




</body></html>